Skip to content

lijkbezorger/yii2-admin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii2 Admin

Latest Stable Version Total Downloads Latest Unstable Version License

Module for administration

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 admin
php yii modules-migrate

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

About

Admin stuff for Yii2

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 98.9%
  • Other 1.1%