PHP code example of yiicod / yii2-systemparams

1. Go to this page and download the library: Download yiicod/yii2-systemparams library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yiicod / yii2-systemparams example snippets


php yii params sync

'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')

public function actions()
{
    return [
        'admin' => [
            'class' => yiicod\systemparam\actions\admin\Admin::class,
        ],
        'update' => [
            'class' => yiicod\systemparam\actions\admin\Update::class,
        ],
    ];
}

   yii migrate --migrationPath=@vendor/yiicod/yii2-systemparam/migrations

php composer.phar