2017 © Pedro Peláez
 

yii2-extension yii2-dbconfig

Yii 2 Database Configuration

image

d4rkstar/yii2-dbconfig

Yii 2 Database Configuration

  • Sunday, February 14, 2016
  • by d4rkstar
  • Repository
  • 3 Watchers
  • 1 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

yii2-dbconfig

This widget will integrate quickly a backend and frontend for application settings., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Install

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

Sample Usage

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)

The Versions

14/02 2016

dev-master

9999999-dev https://github.com/d4rkstar/yii2-dbconfig

Yii 2 Database Configuration

  Sources   Download

BSD-3-Clause

The Requires

 

database extension configuration yii2