Home » HTML » HTML_Menu » Bug #2484
get() ignores previous render()
Details
| Submitted | 2004-10-08 18:27 UTC |
|---|---|
| From | Chris_offenburg at gmx dot de |
| Status | Bogus |
| Package | HTML_Menu |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2004-10-08 18:27 UTC] Chris_offenburg at gmx dot de
Description:
------------
If I used the Current Version of HTML_Menu package. I wanted to use another Renderer (the DirectTreeRenderer) to render a Menu, but it was simply ignored.
I replaced the get() method with this:
-----------------------------------
function get($menuType = '')
{
// This method don't worked for me.
// was renderer() invoked before?
if (empty($this->_renderer)) { //
include_once 'HTML/Menu/DirectRenderer.php';
$renderer =& new HTML_Menu_DirectRenderer();
$this->render($renderer, $menuType);
} else {
$renderer =& $this->_renderer;
}
return $renderer->toHtml();
}
-----------------------------------
This other get() method worked for me.
Reproduce code:
---------------
// $menu is the multidimensional array
$menu =& new HTML_Menu($menu, 'tree');
// $renderer contains the DirectTreeRenderer
$menu->render(&$render);
$menu->show();
Expected result:
----------------
I expected to have the output as a list, but it was ignored and I got a table (because it was overwritten in the get()-method).