I' am trying to make a menu something like WordPress does but in more simple way. In WordPress you can hook up Admin sidebar menu from any php scripts, thats what I' am trying to do.
This are all the array that contains the menu information
$admin_menu_page = array();
$admin_submenu_page = array();
$admin_menu_page[] = array("Dashboard", "dashboard");
$admin_menu_page[] = array("Pages", "pages");
$admin_menu_page[] = array("Setings", "setings");
$admin_submenu_page['dashboard'] = array("Home", "home");
$admin_submenu_page['dashboard'] = array("Update", "update");
$admin_submenu_page['pages'] = array("Add New Page", "new");
$admin_submenu_page['pages'] = array("All Pages", 'pages');
$admin_submenu_page['setings'] = array("SMTP", "smtp");
$admin_submenu_page['setings'] = array("Theme Options", "theme-options");
This is the html part that renders that menu in the page
echo '<ul>';
foreach($admin_menu_page as $menu){
echo '<li>';
echo '<a href="#">';
echo $menu[0];
echo '<ul>';
foreach($admin_submenu_page[$menu[1]] as $submenu){
echo '<li>';
echo '<a href="#">';
echo $submenu;
echo '</a>';
echo '</li>';
}
echo '</ul>';
echo '</a>';
echo '</li>';
}
echo '</ul>';
This is what it looks like at the moment from the above code
This is how the end result should be like
