Hi. I try to change module properties which was set in configs.
For example. My config
'modules' => [
'lazyloading' => [
'class' => 'denar90\lazyloading\LazyLoading',
'modelNamespace' => '\common\models\Items',
]
]
Controller action. Where I call module. I want change value of modelNamespace
$lazyloading = \Yii::$app->getModule('lazyloading');
Yii::$app->params['modules']['lazyloading']['modelNamespace'] = '\common\models\Posts';
return $lazyloading->runAction('lazyloading/index');
Module action
public function actionIndex() {
$module = $this->module;
$items = new $module->modelNamespace; // always value '\common\models\Items\ I want to have '\common\models\Posts'
}
How I can change module properties? Thank you for answers.