承接 exchangecore/yii2-config 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

exchangecore/yii2-config

Composer 安装命令:

composer require exchangecore/yii2-config

包简介

Configuration components for Yii2

README 文档

README

First you must install the extension using composer. To do so simply add it to your application's composer.json like so:

"require": {
    "exchangecore/yii2-config": "dev-master",
},

To set up a configuration repository you should use something similar to below in your yii configuration file. The db and table properties are optional. You MUST name the component 'config' for the DbRepository to work.

'components' => [
    'config' => [
        'class' => 'exchangecore\config\components\DbRepository',
        // 'db' => 'db',
        // 'table' => 'Config'
    ]
],
'modules' => [
    'config' => ['class' => 'exchangecore\config\Module'],
],

Before you can leverage the DbRepository you must install the table. To do so run the following from the command line:

php yii migrate --migrationPath="@exchangecore/config/migrations"

Now you can start saving and getting values from your configuration component like so:

//to save a configuration value
\Yii::$app->config->save('namespace::group.item.item1', $value);
\Yii::$app->config->save('namespace::group.item.item2', $value2);

//to retrieve a configuration value
\Yii::$app->config->get('namespace::group.item.item1'); //returns $value
\Yii::$app->config->get('namespace::group.item'); //returns array('item1' => $value, 'item2' => $value2)

Thanks To

Most of what you'll find in this extension/module is a version of what is used by Concrete5 and Illuminate.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固