Re: HTML_TreeMenu: createFromXML() problems
| From: | Marcin Rociek | Date: | Sun, 19 Oct 2003 20:51:15 +0000 |
| Subject: | Re: HTML_TreeMenu: createFromXML() problems | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8490@lists.php.net to get a copy of this message | ||
2003-10-17, 09:14, Lachy Laycock wrote:
> Has anyone got this function to work?? Are the any working examples
> around?? And, more importantly, is this a problem with the package?
In my case createFromXML() produced errors, but I've found another way
to create menu from XML file:
require_once('HTML/TreeMenu.php');
require_once('Tree/Tree.php');
$tree = Tree::setupMemory('XML', 'menu.xml');
$tree->dataSourceClass->_toLower = false; // (*)
$tree->setup();
$menu = HTML_TreeMenu::createFromStructure(array('structure' => $tree,
'type' => 'kriesing'));
$treeMenu =& new HTML_TreeMenu_DHTML($menu, array('images' => 'images',
'defaultClass' => 'default'));
print($treeMenu->toHTML());
(*) - required if you want use mixedCase attributes (linkTarget,
cssClass, etc.)
The drawback is there can be only one root node, if I'm correct.
HTH
--
Marcin Rociek
www.rociek.com