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

1.0.3 2018-11-02 10:14 UTC

This package is auto-updated.

Last update: 2024-11-27 00:35:59 UTC


README

Latest Stable Version Total Downloads Scrutinizer Code QualityCode Climate

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