Re: DirectTreeRenderer methods syntax
| From: | Alexey Borzov | Date: | Thu, 30 Oct 2008 21:25:07 +0000 |
| Subject: | Re: DirectTreeRenderer methods syntax | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-29389@lists.php.net to get a copy of this message | ||
Hi,
John B Dougherty wrote:
I am trying to configure DirectTreeRenderer to output a menu so it will render a ul required by http://accessat.c-net.us/articles/menu/h_drop-down-menu.html and http://accessat.c-net.us/articles/menu/v_drop-down-menu.html for DHTML Menu 1. Main menu should be an unordered list (<ul>) with class="mainmenu" use DirectTreeRenderer::setLevelTemplate() 2. Each main menu item should be:...- an <li> with id="mainmenu#" where # is sequential, starting at 1 use DirectTreeRenderer::setItemTemplate()- an anchor <a> with class="mainmenu" use DirectTreeRenderer::setEntryTemplate()
$renderer->setEntryTemplate('type','<a href="{url}" class="{class}">{title}</a>');This definitely looks like an error to me, you should pass one of HTML_MENU_ENTRY_... constants as a first parameter here. I'm not sure whether any placeholders at all will be replaced in templates passed in setItemTemplate(), stick to setEntryTemplate() unless you want to hack an existing renderer.