yiicod / yii2-systemparams
Config params with editable in the admin panel for the Yii framework
Installs: 957
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- vitalets/x-editable-yii: 1.3.*
- yii2mod/yii2-editable: 1.*
- yiisoft/yii2: 2.*
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-27 00:20:18 UTC
README
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
Config:
'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')
Usage
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 usage
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