HTML_Menu
| From: | Val | Date: | Tue, 28 Mar 2006 20:12:38 +0000 |
| Subject: | HTML_Menu | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23473@lists.php.net to get a copy of this message | ||
Hi,
I'm using the HTML_Menu package and I've got a problem : I can't change the
renderer of my tree (created with DB_nestedSet). Here is the end of my code
:
// Create the output driver object
$output =& DB_NestedSet_Output::factory($params, 'Menu');
// Fetch the menu array
$structure = $output->returnStructure();
// Create the new HTML_Menu object
$menu = & new HTML_Menu($structure, 'urhere');
// Create the renderer
$renderer = & new HTML_Menu_Renderer(array(
HTML_MENU_ENTRY_INACTIVE => '<td>{indent}<a
href="{url}">{title}
!!ok!!</a></td>',
HTML_MENU_ENTRY_ACTIVE =>
'<td>{indent}<b>{title}</b></td>',
HTML_MENU_ENTRY_ACTIVEPATH => '<td>{indent}<b><a
href="{url}">{title}</a></b></td>',
HTML_MENU_ENTRY_PREVIOUS => '<td><a
href="{url}"><<
{title}</a></td>',
HTML_MENU_ENTRY_NEXT => '<td><a href="{url}">{title}
>></a></td>',
HTML_MENU_ENTRY_UPPER => '<td><a href="{url}">^ {title}
^</a></td>',
HTML_MENU_ENTRY_BREADCRUMB => '<td><a
href="{url}">{title}</a> >>
</td>'
));
// Set the renderer
$menu->render($renderer);
// Create the current URL and send it to HTML_Menu
$currentUrl = $_SERVER['PHP_SELF'].'?nodeID=' . $_GET['nodeID'];
$menu->forceCurrentUrl($currentUrl);
// Show the menu
$menu->show();
It doesn't change anything.....
Thank you very much for your help.
Sincerely