2017 © Pedro Peláez
 

yii2-extension yii2-admin

image

nullref/yii2-admin

  • Thursday, May 24, 2018
  • by ZAYEC77
  • Repository
  • 5 Watchers
  • 2 Stars
  • 932 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 5 Open issues
  • 4 Versions
  • 2 % Grown

The README.md

Yii2 Admin

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Module for administration, (*2)

Check extended version of this module at this link, (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

php composer.phar require --prefer-dist nullref/yii2-admin "*"

or add, (*6)

"nullref/yii2-admin": "*"

to the require section of your composer.json file., (*7)

Then You have run console command for install this module and run migrations:, (*8)

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., (*9)

Please check this documentation section, (*10)

Admin Menu

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',
           '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',
   '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, (*15)

The Versions