2017 © Pedro Peláez
 

yii2-extension yii2-config

Yii2 config

image

shoxabbos/yii2-config

Yii2 config

  • Thursday, January 18, 2018
  • by shoxabbos
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 13 % Grown

The README.md

Yii2 config

Yii2 simple config, (*1)

Installation

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

Either run, (*3)

php composer.phar require --prefer-dist shoxabbos/yii2-config "*"

or add, (*4)

"shoxabbos/yii2-config": "*"

to the require section of your composer.json file., (*5)

Demo

alt text, (*6)

Usage

Once the extension is installed, simply use it in your code by :, (*7)

Run migrations
./yii migrate  --migrationPath="@shoxabbos/config"
Controller map

For example: adding settings pages to admin module, (*8)

'modules' => [
    'admin' => [
        'class' => 'app\modules\admin\Module',
        'controllerMap' => [
            'config' => 'shoxabbos\config\controllers\ConfigController'
        ]
    ],
]

After that, you can open the pages as:, (*9)

/admin/config/create
/admin/config/update
/admin/config/view
/admin/config/index

Conponent

Register the package as a component, (*10)

'components' => [
    'config' => [
        'class' => 'shoxabbos\config\Config',
    ],
]
Get config object
\Yii::$app->config->get('key');
Get config object property
\Yii::$app->config->get('key', 'propertyName');
Set cache duration
\Yii::$app->config->get('key', 'propertyName', 3600 * 24);
Set config
\Yii::$app->config->set('key', 'varchar 255', 'text');

The Versions

18/01 2018

dev-master

9999999-dev

Yii2 config

  Sources   Download

MIT

The Requires

 

by Avatar shoxabbos

extension yii2

18/01 2018

1.0.0

1.0.0.0

Yii2 config

  Sources   Download

MIT

The Requires

 

by Avatar shoxabbos

extension yii2