PHP Classes

File: app/modules/UserGroup/Initialize.php

Recommend this page to a friend!
  Classes of ikhsan   Slim Starter   app/modules/UserGroup/Initialize.php   Download  
File: app/modules/UserGroup/Initialize.php
Role: Application script
Content type: text/plain
Description: UserGroup module initializer
Class: Slim Starter
Build MVC Web applications based on Slim framework
Author: By
Last change: Update of app/modules/UserGroup/Initialize.php
Date: 5 months ago
Size: 1,299 bytes
 

Contents

Class file image Download
<?php

namespace UserGroup;

use \
App;
use \
Menu;
use \
Route;

class
Initialize extends \SlimStarter\Module\Initializer{

    public function
getModuleName(){
        return
'UserGroup';
    }

    public function
getModuleAccessor(){
        return
'usergroup';
    }

    public function
registerAdminMenu(){

       
$adminMenu = Menu::get('admin_sidebar');

       
$userGroup = $adminMenu->createItem('usergroup', array(
           
'label' => 'User and Group',
           
'icon' => 'group',
           
'url' => '#'
       
));
       
$userGroup->setAttribute('class', 'nav nav-second-level');

       
$userMenu = $adminMenu->createItem('user', array(
           
'label' => 'User',
           
'icon' => 'user',
           
'url' => 'admin/user'
       
));

       
$groupMenu = $adminMenu->createItem('group', array(
           
'label' => 'Group',
           
'icon' => 'group',
           
'url' => 'admin/group'
       
));

       
$userGroup->addChildren($userMenu);
       
$userGroup->addChildren($groupMenu);

       
$adminMenu->addItem('usergroup', $userGroup);
    }

    public function
registerAdminRoute(){
       
Route::resource('/user', 'UserGroup\Controllers\UserController');
       
Route::resource('/group', 'UserGroup\Controllers\GroupController');
    }
}