J. Doe
J. Doe

Reputation: 1732

Get module config params

In every module i have config(with params and etc.). Registration

\Yii::configure($this, require __DIR__ . '/config/config.php');

How I get params from another module? For example: in user module i need params from product module.

Upvotes: 0

Views: 1845

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133380

You could get the module ref eg using the related id (eg: user)

$moduleUser = \Yii::$app->getModule('user');

then you can access to the related param (eg: myParam)

$myParam = $moduleUser->params['myParam'];

Upvotes: 1

Related Questions