2017 © Pedro Peláez
 

yii2-extension smart-settings

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

image

esoftslimited/smart-settings

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

  • Thursday, May 26, 2016
  • by Esofts
  • Repository
  • 1 Watchers
  • 0 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Smart Settings

A cool plugin that is extensible that add support for addition of system wide settings into your application, (*1)

Installation

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

Either run, (*3)

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

or add, (*4)

"esoftslimited/smart-settings": "*"

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

Import Database

Configuration

Once the extension is installed, simply use it in your code by :, (*6)

Configuration

Add the following to your configuration file under component section, (*7)

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

   ],
  ...
  ?>

Migration

Run the following commond in your terminal to install latest database, (*8)


$ 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, (*9)

esoftslimited\settings\widgets\SettingsPanel;

Using the widget on Views

Just pass configuration to the SettingsPanel, (*10)

=\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, (*11)

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

The Versions

26/05 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Elijah Mwangi

extension yii2