nullref / yii2-admin
Installs: 1 216
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 6
Forks: 2
Open Issues: 5
Type:yii2-extension
Requires
- php: >=5.5.0
- nullref/yii2-core: >=0.0.4
- nullref/yii2-sb-admin-2: >=0.0.2
- nullref/yii2-useful: >=0.0.4
- yiisoft/yii2: >=2.0.13
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-29 04:52:56 UTC
README
Module for administration
Check extended version of this module at this link
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist nullref/yii2-admin "*"
or add
"nullref/yii2-admin": "*"
to the require section of your composer.json
file.
Then You have run console command for install this module and run migrations:
php yii module/install nullref/yii2-admin
php yii modules-migrate
Pay attention that if you don't use our application template it needs to change config files structure to have ability run commands that show above.
Please check this documentation section
Admin Menu
For adding items to admin menu you have to implement IAdminModule interface, e.g.:
public static function getAdminMenu() { return [ 'label' => \Yii::t('admin', 'Subscription'), 'icon' => 'envelope', 'items' => [ 'emails' => ['label' => \Yii::t('app', 'Subscribers'), 'icon' => 'envelope-o', 'url' => ['/subscription/email/index']], 'messages' => ['label' => \Yii::t('app', 'Messages'), 'icon' => 'envelope-o', 'url' => ['/subscription/message/index']], ] ]; }
Admin Controller
If you use IAdminController
interface in controller, admin layout and default access rule will be set in controller before action.
Modules system
This module integrated in system which contain other useful components. View details
Overriding
Example:
/** module config **/ 'admin' => [ 'class' => 'nullref\admin\Module', 'adminModel' => 'app\models\Admin', // admin model class 'controllerMap' => [ //controllers 'user' => 'app\modules\admin\controllers\UserController', 'main' => 'app\modules\admin\controllers\MainController', ], 'components' => [ //menu builder 'menuBuilder' => 'app\\components\\MenuBuilder', ], ],
And translations