sadi01 / yii2-more-settings
Handle Settings For Yii2 Framework
Installs: 84
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- ext-curl: *
- ext-json: *
- kartik-v/yii2-bootstrap4-dropdown: @dev
- kartik-v/yii2-grid: @dev
- kartik-v/yii2-number: @dev
- kartik-v/yii2-widget-fileinput: @dev
- sadi01/yii2-daterangepicker: *
- yiisoft/yii2: ~2.0.14
- yiisoft/yii2-jui: ^2.0@dev
This package is auto-updated.
Last update: 2024-11-18 13:40:37 UTC
README
Handle settings for Yii 2
For license information check the LICENSE-file.
Installation
1. Download
The preferred way to install this extension is through composer:
composer require --prefer-dist sadi01/yii2-more-settings:"*"
2. Configuration
To use this extension, you have to configure the PostService class in your application configuration:
return [ //.... 'modules' => [ 'moresettings' => [ 'class' => 'sadi01\moresettings\SettingsModule', 'rootAlias' => '@webroot', 'webAlias' => '@web', ], ] ];
3. Update database schema
The last thing you need to do is updating your database schema by applying the
migrations. Make sure that you have properly configured db
application component
and run the following command:
$ php yii migrate/up --migrationPath=@vendor/sadi01/yii2-more-settings/src/migrations
How To Use
Manage setting categories and settings :
http://yourdomain/moresettings/default/index http://yourdomain/moresettings/setting-cat/index
Get value of setting:
use sadi01\moresettings\models\SettingValue; SettingValue::getValue('settingCategory', 'settingName')
Setting widget for change value of setting:
use sadi01\moresettings\widgets\SettingsWidget <?= SettingsWidget::widget([ 'model' => $model, 'categoryName' => 'mainSettings', // name of Setting category 'settingName' => 'apiBaseUrl' // name of setting ]) ?>