Giter VIP home page Giter VIP logo

smart-settings's Introduction

Smart Settings

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
            ],
        ];
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.