承接 olessavluk/yii2-settings 相关项目开发

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

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

olessavluk/yii2-settings

Composer 安装命令:

composer require olessavluk/yii2-settings

包简介

Simple yii2 component for persistent settings storage

README 文档

README

Simple yii2 component for persistent settings storage

Installation:

The preferred way to install this extension is through composer.

Either run

php composer.phar require olessavluk/yii2-settings "*@dev"

or add

"olessavluk/yii2-settings": "*@dev"

to your composer.json file.

Usage

Add migration to create table for settings:

class m150929_124601_settings extends olessavluk\settings\m150929_122401_settings
{
}

Add the following code in your application configuration:

'components' => [
  ...
  /**
   * required for advanced application template,
   * to share cache between frontend and backend
   */
  'frontCache' => [
     'class' => 'yii\caching\FileCache',
     'cachePath' => '@frontend/runtime/cache',
  ],
  'settings' => [
      'class' => '\olessavluk\settings\SettingsComponent',
      'cacheName' => 'frontCache',
      'defaults' => [ //optional default settings
          'app' => [
              'siteName' => 'MyApp',
              'adminEmail' => 'admin@exapmle.com',
              'fromEmail' => 'no-reply@example.com',
          ],
      ],
  ],
  ...
]

Now you can use this component:

Yii->$app->settings->get('app', 'siteName');
Yii->$app->settings->delete('app', 'siteName');
Yii->$app->settings->set('app', 'siteName', 'NewSiteName');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固