dev-master
9999999-devA cool plugin that is extensible that add support for addition of system wide settings into your application
MIT
The Requires
by Elijah Mwangi
extension yii2
Wallogit.com
2017 © Pedro Peláez
A cool plugin that is extensible that add support for addition of system wide settings into your application
A cool plugin that is extensible that add support for addition of system wide settings into your application, (*1)
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)
Once the extension is installed, simply use it in your code by :, (*6)
Add the following to your configuration file under component section, (*7)
'components'=>[
'settings'=>['class'=>' \esoftslimited\settings\components\Settings']
],
...
?>
Run the following commond in your terminal to install latest database, (*8)
$ php yii migrate --migrationPath=@vendor/esoftslimited/smart-settings/migrations --interactive=1
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;
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;*/
])
?>
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
],
];
}
A cool plugin that is extensible that add support for addition of system wide settings into your application
MIT
extension yii2