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

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

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

smarteng/yii2-config

Composer 安装命令:

composer require smarteng/yii2-config

包简介

Yii2 manage config from database

README 文档

README

Manage configuration from database

Installation

Either run

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

or add

"smarteng/yii2-config": "*"

to the require section of your composer.json file.

Two

Applying migrations

yii migrate --migrationPath=@vendor/smarteng/yii2-config/migrations

Configuration

In configuration file

'components' => [
    'config' => [
        'class' => '\smarteng\config\components\Config',
        'provider' => [
            'class' => '\smarteng\config\providers\DbProvider',
            'tableName' => '{{%config}}',  // by default
            'keyColumn' => 'key',                 // by default
            'valueColumn' => 'value',             // by default
        ]
    ],
    ...
]

Create own provider

  1. Create Class for provider
  2. Implement \smarteng\config\components\ConfigInterface
  3. Change in the configuration file on your provider

Usage

Db provider example

$isSet = \Yii::$app->config->set('commission', '10');   // can throw an exception
$isSet = \Yii::$app->config->safeSet('commission', '10');   // return false if something went wrong

$isSet = \Yii::$app->config->exists('commission');      // return true if key exists
$value = \Yii::$app->config->get('commission');         // return '10';

Uninstall

Applying migrations

yii migrate/down --migrationPath=@vendor/smarteng/yii2-config/migrations

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-12-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固