I’ve got DB. I use Zend Navigation to generate the menu. But I want that my menu would be dynamically editable from panel. My menu has also sub-menus.
My db:
id title parent
1 First 0
2 sub_first 1
3. sub_first_2 1
4. second 0
5. sub_second 4
I want to export it in XML in that way:
<first>
<sub_first>
</sub_first>
<sub_first_2>
</sub_first_2>
</first>
How to generate xml from DB which will looks like the one I wrote?
I would encapsulate the iteration with a
RecursiveIteratorso you can easily create whatever output you desire.You can use it to create the XML:
Or the
Zend_Navigation:Usage: