it-yakutia / yii2-setting
Setting module for Yii2
Installs: 767
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- uraankhayayaal/yii2-materializecomponents: ~1.0.1
- uraankhayayaal/yii2-redactor: ~1.0.0
- uraankhayayaal/yii2-sortable: ~1.0.1
- yiisoft/yii2: ~2.0.0
README
Setting module for Yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist it-yakutia/yii2-setting "*"
or add
"it-yakutia/yii2-setting": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply add in your console config:
'controllerMap' => [ /* ... */ 'migrate' => [ // 'class' => 'yii\console\controllers\MigrateController', 'migrationPath' => [ // '@console/migrations', // yii migrate/create app_init // '@yii/rbac/migrations', /* ... */ '@vendor/it-yakutia/yii2-setting/src/migrations' ], ], ],
And just run the command:
php yii migrate
Add urls in your backend project:
Url::toRoute('/setting/back/index');
Check permission settings
that it are added to your RBAC role
Use in front:
<span><a href="<?= Setting::valueOf('social_link_vk'); ?>"><i class="fab fa-vk"></i></a></span>
or
<?= Setting::valueOf('social_link_vk', '<span><a href="[[value]]"><i class="fab fa-vk"></i></a></span>'); ?>