simplator / admin
Yii2 admin tools
Installs: 138
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
This package is not auto-updated.
Last update: 2018-07-31 00:37:59 UTC
README
Yii2 admin
Bases on pheme/yii2-admin
Added multidomain configuration
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist simplator/admin "*"
or add
"simplator/admin": "*"
to the require section of your composer.json
file.
Subsequently, run
./yii migrate --migrationPath=@yii/rbac/migrations/
in order to create the admin table in your database.
Usage
There are 2 parts to this extension. A module and a component. The module provides a simple GUI to edit your admin. The component provides a way to retrieve and save admin programmatically.
Add this to your main configuration's modules array
'modules' => [ 'admin' => [ 'class' => 'simplator\admin\Module', ], ... ],
Add this to your main configuration's components array
'components' => [ 'admin' => [ 'class' => 'simplator\admin\components\admin' ], ... ]
Typical component usage
$admin = Yii::$app->admin; $value = $admin->get('section.key'); $value = $admin->get('key', 'section'); $admin->set('section.key', 'value'); $admin->set('section.key', 'value', null, 'string'); $admin->set('key', 'value', 'section', 'integer'); // Automatically called on set(); $admin->clearCache();