fgh151/yii2-params Yii2 params files managment

params

Русская документация скоро будет доступна доступна на сайте OpenItStudio

Yii2 params files management utility

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist fgh151/yii2-params "*"

or add

"fgh151/yii2-params": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply add it in your config by :

        'modules' => [
               ...
               'params' => [
                   'class' => 'fgh151\modules\params\Module',
                   'paramsFilePath' => [
                       'Common params' => '@common/config/params.php',
                       'Backend Params' => '@backend/config/params.php',
                       'Frontend Params' => '@frontend/config/params.php',
                   ]
               ]
           ],

add to paramsFilePath array names of files and path to them

RBAC

You can use RBAC with module. Simply add it in your config:

        'modules'    => [
             'params' => [
                'class' => 'fgh151\modules\params\Module',
                'paramsFilePath' => [
                    'Common params' => '@common/config/params.php',
                    'Backend Params' => '@backend/config/params.php',
                    'Frontend Params' => '@frontend/config/params.php',
                ],
                'as access' => [
                    'class' => 'yii\filters\AccessControl',
                    'rules' => [
                        [
                            'allow' => true,
                            'roles' => ['admin'],
                        ]
                    ]
                ]
             ]
            ...
        ],

Usage

Pretty Url's /params

No pretty Url's index.php?r=params

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.5 is the latest of 4 releases



GPL license
Stats
3 github stars & 2 github forks
0 downloads in the last day
0 downloads in the last 30 days
210 total downloads