Zend Framework: Navigation XML and duplicate page elements

Majora

New Member
In XML I'd normal expect the following to be perfectly valid and navigable in a meaningful way using something like PHP's DomDocument:\[code\]<?xml version="1.0" encoding="UTF-8"?><configdata> <page> <name>Home</name> </page> <page> <name>Log in</name> </page></configdata>\[/code\]This is not the case when using \[code\]Zend_Navigation\[/code\]. Each \[code\]<page>\[/code\] element needs to have a unique name, so you would need to do:\[code\]<?xml version="1.0" encoding="UTF-8"?><configdata> <page_home> <name>Home</name> </page_home> <page_log_in> <name>Log in</name> </page_log_in></configdata>\[/code\]This works, but is very annoying. I'd much rather have multiple page elements which can have the same name and can be easily copy and pasted when creating many pages for navigation.Why does each one need a unique name? Is there a way of not having to have a unique name?@CharlesYes, the following code is used to read in the navigaion XML\[code\]$config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml');$container = new Zend_Navigation($config);Zend_Registry::set("navigation", $container);\[/code\]@GordonGood question...I used to use this method, but wanted another way that was easier to update and read. The array notation does solve the issue I have but it isn't an easy way of writing out the navigation for a site, especially when there are nested elements. XML is much easy to read and make sense of than PHP's arrays.Granted this is my own opinion and it is a slower way of storing and parsing navigation data.
 
Top