Answer the question
In order to leave comments, you need to log in
How to transfer params.php to a module?
How to transfer config\params.php to a module and take parameters from there in the module?
Answer the question
In order to leave comments, you need to log in
In the documentation for modules, just the example you need
www.yiiframework.com/doc-2.0/guide-structure-modul...
namespace app\modules\forum;
class Module extends \yii\base\Module
{
public function init()
{
parent::init();
// initialize the module with the configuration loaded from config.php
\Yii::configure($this, require(__DIR__ . '/config.php'));
}
}
<?php
return [
'components' => [
// list of component configurations
],
'params' => [
// list of parameters
],
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question