-
Notifications
You must be signed in to change notification settings - Fork 46
Function : add_admin_menu()
Description : This function provide a way to add multiple menus with sub-menus on dashboard left menu. It's takes 3 parameters :
-
The position where to add menu (Before or After)[required/String]
-
The item concerned by the addition (menu, controllers, installer, modules, themes, settings, system, frontend)[required/String]
-
The menu Array, which is an associative Array with required keys in order to be valid. Those keys are : title, href. [required/Array]
You can add optional keys to complete your menu, with : icon, childs. the Childs key let you add sub-menus to a menu. Those children can't have children at their turn. so, one level is only supported.
Since Tendoo Dashboard support FontAwesome, icon can be a valid class to existent fa icon, like "fa fa-bell" and so on.
Example :
<?php
add_admin_menu( 'before' , 'controller' , array(
'title' => 'Hello World',
'href' => '#'
) );?>
or
<?php
add_admin_menu( 'before' , 'controller' , array(
'title' => 'Hello World',
'href' => '#',
'icon' => 'fa fa-bell',
'childs' => array(
array(
'title' => 'Child 1',
'href' => '#'
)
)
) );?>
Note : Childs doesn't support icon yet.