Yii2 Full Admin
, (*1)
Module for administration with user management, (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
php composer.phar require --prefer-dist nullref/yii2-full-admin "*"
or add, (*5)
"nullref/yii2-full-admin": "*"
to the require section of your composer.json
file., (*6)
Then You have run console command for install this module and run migrations:, (*7)
php yii module/install nullref/yii2-full-admin
Also, you have to add \nullref\fulladmin\Bootstrap
class to bootstrap:, (*8)
//config
'bootstrap' => [
//..
\nullref\fulladmin\Bootstrap::class,
//...
],
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., (*9)
Please check this documentation section, (*10)
For adding items to admin menu you have to implement IAdminModule interface, e.g.:, (*11)
public static function getAdminMenu()
{
return [
'label' => \Yii::t('admin', 'Subscription'),
'icon' => 'envelope',
'order' => 0,
'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., (*12)
Modules system
This module integrated in system which contain other useful components. View details, (*13)
Overriding
Example:, (*14)
/** module config **/
'admin' => [
'class' => 'nullref\admin\Module',
'controllerMap' => [ //controllers
'main' => 'app\modules\admin\controllers\MainController',
],
'components' => [ //menu builder
'menuBuilder' => 'app\\components\\MenuBuilder',
],
],
And translations, (*15)