2017 © Pedro Peláez
 

yii2-extension yii2-configurator

一个简单的配置管理组件

image

toshcn/yii2-configurator

一个简单的配置管理组件

  • Friday, July 27, 2018
  • by toshcn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

yii2-configurator

一个简单的配置管理组件, (*1)

Installation

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

Either run, (*3)

php composer.phar require --prefer-dist toshcn/yii2-configurator "*"

or add, (*4)

"toshcn/yii2-configurator": "*"

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

Usage

配置组件:, (*6)

'components' => [
    'config' => [
        'class' => 'toshcn\yii2\configurator\Configurator',
    ],
]

运行数据迁移:, (*7)

php yii migrate --migrationPath=@vendor/toshcn/yii2-configurator/src/migrations

添加配置:基础模板在config->console.php,高级模板在console->config->main.php, (*8)

Yii::$app->config->createConfig('myconfig', json_encode(['key' => 'value']), 'my first config');

获取配置项:, (*9)

Yii::$app->config->getConfigItem('myconfig', 'key', 'defaultValue');
//返回 key对应的值 value, 如果key不存在,返回 'defaultValue'

获取全部配置项:, (*10)

Yii::$app->config->getConfigItemAll('myconfig', ['key' => 'defaultValue']);
//返回 myconfig 配置的全部项, 可以指定配置项的默认值,如果key不存在,key的值会设为'defaultValue'

The Versions

27/07 2018

1.0.x-dev

1.0.9999999.9999999-dev

一个简单的配置管理组件

  Sources   Download

MIT

The Requires

 

by Avatar toshcn

extension yii2 configurator

27/07 2018

dev-master

9999999-dev

一个简单的配置管理组件

  Sources   Download

MIT

The Requires

 

by Avatar toshcn

extension yii2 configurator

27/07 2018

dev-dev

dev-dev

一个简单的配置管理组件

  Sources   Download

MIT

The Requires

 

by Avatar toshcn

extension yii2 configurator