PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_Menu » Bug #2484

get() ignores previous render()

Details

Submitted2004-10-08 18:27 UTC
FromChris_offenburg at gmx dot de
StatusBogus
PackageHTML_Menu
PHP VersionIrrelevant
OSIrrelevant
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).