zarv1k / yii2-params
Yii2 Advanced params
Installs: 43
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: >=2.0.4
README
This extension provides the advanced params for Yii 2 applications. (Warning: this extension is under development, unstable and not for production use)
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist zarv1k/yii2-params "*"
or add
"zarv1k/yii2-params": "*"
to the require section of your composer.json
file.
Run migrations to create params table in DB:
yii migrate --migrationPath=@zarv1k/params/migrations
Once the extension is installed, simply modify your application configuration as follows:
return [ // ... 'params' => '@zarv1k/params/config/default.php', // ... ];
Or use your custom params component configuration as follows:
return [ // ... 'params' => [ 'class' => 'zarv1k\params\components\Params', 'filePath' => '@app/config/params.php' ], // ... ];
To manage application params on your web site you can turn on the params module:
return [ // ... 'modules' => [ // ... 'params' => [ 'class' => 'zarv1k\params\modules\params\Module' ], // ... ], ];
Then you can then access params module through the following URL:
http://localhost/path/to/index.php?r=params
or if you have enabled pretty URLs, you may use the following URL:
http://localhost/path/to/index.php/params
Usage
\Yii::$app->params['param_scope.param_code']