esoftslimited/smart-settings 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

esoftslimited/smart-settings

Composer 安装命令:

composer require esoftslimited/smart-settings

包简介

A cool plugin that is extensible that add support for addition of system wide settings into your application

README 文档

README

A cool plugin that is extensible that add support for addition of system wide settings into your application

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist esoftslimited/smart-settings "*"

or add

"esoftslimited/smart-settings": "*"

to the require section of your composer.json file.

Import Database

Configuration

Once the extension is installed, simply use it in your code by :

Configuration

Add the following to your configuration file under component section

  'components'=>[
    'settings'=>['class'=>' \esoftslimited\settings\components\Settings']

   ],
  ...
  ?>

#Migration Run the following commond in your terminal to install latest database

 
 $ php yii migrate --migrationPath=@vendor/esoftslimited/smart-settings/migrations --interactive=1

View Management

#SettingPanel Widget This module have a robust view components which autogenerates settings views/forms. The widget is configurable and flexible and can be used almost anywhere

esoftslimited\settings\widgets\SettingsPanel;

#Using the widget on Views Just pass configuration to the SettingsPanel

<?=\esoftslimited\settings\widgets\SettingsPanel::widget([
	'category'=>[], //categories of setting to be tabbed
	'selected'=>'category.name',//current active categry
	'scope'=>'custom|system_setting',//current scope
	'parent'=>0// parent object
	/* More Custom settings*/
	/*'template'
	'input_template'
	'checkboxTemplate'
	'checkboxOptions'
	'buttonOptions'=>[]//default submit settings panel
	'addSeparator'=>true;*/

	])
?>

#Saving and updating Settings Value The module come with add on actio for any controller implementing it for ease of updating and configuring settings In your settings Controller

    /**
     * @inheritdoc
     */
    public function actions()
    {
        return [
            ----
            'update'=>[
              'class'=>'\esoftslimited\settings\actions\SettingsAction',
              'view'=>'index',//custom view goes here
            ],
        ];
    }

统计信息

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

GitHub 信息

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

其他信息

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