Answer the question
In order to leave comments, you need to log in
How to add modules to the system on YII2 through the admin panel?
Please share your experience, I'm
interested in the technology by which it would be possible to connect different modules of this system to the system on Yii2 through the admin panel if necessary.
That is, you probably need some kind of script that would write the necessary information to the necessary files by module, or would the system itself somehow miraculously see the module that appeared and start working with it?
Thank you!
Answer the question
In order to leave comments, you need to log in
First develop and prepare all available modules. In the main.php/main-local.php file (or in another place where the modules are supposed to be connected) enter this:
$modules = require('/path/to/modules/file.php');
// и далее
return [
'modules' => array_merge($modules, [
'user' => [
'class' => common\modules\user\Module::className(),
],
]),
];
'/path/to/modules/file.php'
with the following content will be generated from all active modules:return [
'questions' => [
'class' => common\modules\poll\questions\Module::className(),
],
'answers' => [
'class' => common\modules\poll\answers\Module::className(),
],
'news' => [
'class' => common\modules\news\Module::className(),
],
'tags' => [
'class' => common\modules\tags\Module::className(),
],
'categories' => [
'class' => common\modules\categories\Module::className(),
],
'images' => [
'class' => common\modules\images\Module::className(),
],
'uploader' => [
'class' => common\modules\uploader\Module::className(),
],
'content' => [
'class' => common\modules\content\Module::className(),
],
'employees' => [
'class' => common\modules\employees\Module::className(),
],
'comments' => [
'class' => common\modules\comments\Module::className(),
],
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question