With this extension you easy config your Yii::$app->params from admin panel. You need install extension with composer and run command:
php yii params sync
This is command for synchronize your php config with db.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yiicod/systemparam "*"
or add
"yiicod/systemparam": "*"
to your composer.json
'components' => array(
...
'systemparams => [
'commandMap' => [
'params' => [
'class' => SystemParamCommand::class,
'paramsAlias' => '@app/../common/config/params-system.php',
],
],
'modelMap' => [
'systemParam' => [
'class' => SystemParamModel::class,
],
'systemParamSearch' => [
'class' => SystemParamSearch::class,
],
],
'cacheDuration' => 28800,
'components' => [],
]
...
)
'bootstrap' => array('systemparams')
Use (or extend) yiicod\systemparams\controllers, or add to your controller crud actions:
public function actions()
{
return [
'admin' => [
'class' => yiicod\systemparam\actions\admin\Admin::class,
],
'update' => [
'class' => yiicod\systemparam\actions\admin\Update::class,
],
];
}
Migration command or use manual(http://www.yiiframework.com/doc-2.0/guide-db-migrations.html) for configuration:
yii migrate --migrationPath=@vendor/yiicod/yii2-systemparam/migrations