PHP code example of nullref / yii2-admin

1. Go to this page and download the library: Download nullref/yii2-admin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nullref / yii2-admin example snippets


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']],
           ]
       ];
   }

/** 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',
   ],
],

php composer.phar 

php yii module/install nullref/yii2-admin
php yii modules-migrate