For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2004 > HTML_Menu problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HTML_Menu problem
Vincent Dupont

2004-06-28, 4:08 pm

Hi,

I tried the HTML_menu example from the End-user documentation, but it =
seems I have a problem with most displays. Indeed, only the 'sitemap' =
works.
When trying the 'tree' view, only the first level is displayed, even =
after I click on a link in the menu.
Here is the test code. I changed the URLS so as to point to an existing =
file...

With 'sitemap' view, the menu is fully displayed

Do I need something special? sessions? cache? How does the HTML_menu get =
track of the current menu item to display sub menus?

Thank you,
Vincent


<?php
$data =3D array(
1 =3D> array(
'title' =3D> 'Menu item 1',=20
'url' =3D> '/test/html_menu_test.php?sdfg=3Ddslk',
'sub' =3D> array(
11 =3D> array(
'title' =3D> 'Menu item 1.1',=20
'url' =3D> '/test/html_menu_test.php?a=3D11'
),
12 =3D> array(
'title' =3D> 'Menu item 1.2',=20
'url' =3D> '/test/html_menu_test.php?a=3D12&b=3D0',
'sub' =3D> array(
121 =3D> array('title' =3D> 'Menu item 1.2.1', 'url' =
=3D> '/test/html_menu_test.php?a=3D12&b=3D1'),
122 =3D> array('title' =3D> 'Menu item 1.2.2', 'url' =
=3D> '/test/html_menu_test.php?a=3D12&b=3D2')
)
)
)
),
2 =3D> array(
'title' =3D> 'Menu item 2',=20
'url' =3D> '/test/html_menu_test.php?a=3D2',
'sub' =3D> array(
21 =3D> array('title' =3D> 'Menu item 2.1', 'url' =3D> =
'/test/html_menu_test.php?a=3D21'),
22 =3D> array('title' =3D> 'Menu item 2.2', 'url' =3D> =
'/test/html_menu_test.phpa=3D22')
)
)
);


require_once("html/Menu.php");
$menu =3D new HTML_Menu($data, 'tree');
$output .=3D $menu->get();
print($output);

?>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com