Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yiicod/yii2-systemparams
https://github.com/yiicod/yii2-systemparams
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yiicod/yii2-systemparams
- Owner: yiicod
- License: other
- Created: 2017-08-25T11:43:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-19T22:26:20.000Z (about 6 years ago)
- Last Synced: 2024-04-20T19:25:51.280Z (9 months ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
Yii SystemParam extension
=========================[![Latest Stable Version](https://poser.pugx.org/yiicod/yii2-systemparams/v/stable)](https://packagist.org/packages/yiicod/yii2-systemparams) [![Total Downloads](https://poser.pugx.org/yiicod/yii2-systemparams/downloads)](https://packagist.org/packages/yiicod/yii2-systemparams) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yiicod/yii2-systemparams/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yiicod/yii2-systemparams/?branch=master)[![Code Climate](https://codeclimate.com/github/yiicod/yii2-systemparams/badges/gpa.svg)](https://codeclimate.com/github/yiicod/yii2-systemparams)
With this extension you easy config your Yii::$app->params from admin panel.
You need install extension with composer and run command:
```php
php yii params sync
```
This is command for synchronize your php config with db.The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist yiicod/systemparam "*"
```
or add
```json
"yiicod/systemparam": "*"
```
to your composer.json#### Config:
```php
'components' => array(
...
'systemparams => [
'commandMap' => [
'params' => [
'class' => SystemParamCommand::class,
'paramsAlias' => '@app/../common/config/params-system.php',
],
],
'modelMap' => [
'systemParam' => [
'class' => SystemParamModel::class,
],
'systemParamSearch' => [
'class' => SystemParamSearch::class,
],
],
'cacheDuration' => 28800,
'components' => [],
]
...
)
'bootstrap' => array('systemparams')
```#### Usage
Use (or extend) yiicod\systemparams\controllers, or add to your controller crud actions:
```php
public function actions()
{
return [
'admin' => [
'class' => yiicod\systemparam\actions\admin\Admin::class,
],
'update' => [
'class' => yiicod\systemparam\actions\admin\Update::class,
],
];
}
```#### Migration usage
Migration command or use manual(http://www.yiiframework.com/doc-2.0/guide-db-migrations.html) for configuration:
```php
yii migrate --migrationPath=@vendor/yiicod/yii2-systemparam/migrations
```