Search code examples
zend-frameworkrsszend-navigationzend-feed

How to use zend_navigation to populate zend_feed?


In the bootstrap file of each of my modules I am populating my Zend_Navigation instance so that I can create html/xml sitemaps, side-bar navigation, admin navigation and, now, I want to create an rss feed.

Instead of duplicating code and adding the pages to Zend_Feed, is there a way to use Zend_Navigation to populate Zend_Feed?


Solution

  • I extended Zend_View_Helper_Navigation to take the nav, create an array ($feed) of items that Zend_Feed would accept, and returned Zend_Feed::importBuilder(new Zend_Feed_Builder($feed), 'rss')->saveXML();