dev-master
9999999-dev https://github.com/d4rkstar/yii2-dbconfigYii 2 Database Configuration
BSD-3-Clause
The Requires
database extension configuration yii2
Yii 2 Database Configuration
This widget will integrate quickly a backend and frontend for application settings., (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
$ php composer.phar require d4rkstar/yii2-dbconfig "dev-master"
or add, (*4)
"d4rkstar/yii2-dbconfig": "dev-master"
to the require
section of your composer.json
file., (*5)
You'll need to apply database migration from the CLI:, (*6)
./yii migrate --migrationPath=@vendor/d4rkstar/yii2-dbconfig/migrations
In the parameter bootstrap
of your app/config/web.php
, add:, (*7)
'bootstrap' => ['log','dbconfig'],
In the section components
of your app/config/web.php
, add:, (*8)
'components' => [ ... 'dbconfig' => [ 'class'=>'d4rkstar\dbconfig\components\ConfigurationUtils', ], ]
In the section modules
of your app/config/web.php
, add:, (*9)
'modules' => [ ... 'dbconfig' => [ 'class' => 'd4rkstar\dbconfig\Module', ], ]
Anywhere in your code, you can read settings easyly:, (*10)
... $myValue = Yii::$app->dbconfig->section->parameter->value; ...
You can administer the settings from the url dbconfig/settings/index. You can add new settings from the url dbconfig/settings/manage., (*11)
Yii 2 Database Configuration
BSD-3-Clause
database extension configuration yii2