I' am getting `
Notice: Undefined index: index.php in xxxxx/index.php on line 26
When I remove the $submenu variable array from menu.php. Everything works fine but when I add $submenu array variable I get error message. ` What I' am trying to do here is get the top level first and then search if theirs any child submneu
On index.php file I have this code
foreach($menu as $menu){
$title = $menu[0];
$privllages = $menu[1];
$template = $menu[2];
$class = $menu[3];
$id = $menu[4];
$icon = $menu[5];
if(!$title){$title = 'No Title';}
if($class){$class = 'class="'.$class.'"';} else {$class = '';}
if($id){$id = 'id="'.$id.'"';} else {$id = '';}
if(!$icon){$icon = "menu-default.png";}
echo '<a href="'.$template.'" '.$class.' '.$id.'>' . $title . '</a>' . "<br/>";
/* LINE 26 Starts here */
if($submenu[$template]){
foreach($submenu[$template] as $submenu){
echo '<a href="#">' . $submenu[0] . '</a>' . "<br/>";
}
}
}
On menu.php file
$menu[1] = array('Dashboard', '0', 'index.php', 'sidebar-menu','','menu-dashboard');
$menu[2] = array('Pages', '0', 'pages.php', 'sidebar-menu','','menu-dashboard');
$menu[3] = array('Media', '0', 'media.php', 'sidebar-menu','','menu-dashboard');
$menu[4] = array('Tools', '0', 'tools.php', 'sidebar-menu','','menu-dashboard');
$menu[5] = array('Users', '0', 'users.php', 'sidebar-menu','','menu-dashboard');
$menu[6] = array('Settings', '0', 'settings.php', 'sidebar-menu','','menu-dashboard');
$submenu['pages.php'][1] = array( 'All Links 1', 'admin-menu', 'manage_links', 'link-manager.php' );
$submenu['pages.php'][2] = array( 'All Links 2', 'admin-menu', 'manage_links', 'link-manager.php' );
$submenu['pages.php'][3] = array( 'All Links 3', 'admin-menu', 'manage_links', 'link-manager.php' );
$submenu['pages.php'][4] = array( 'All Links 4', 'admin-menu', 'manage_links', 'link-manager.php' );