Jump to content

Zend Framework intro questions


skaterdav85

Recommended Posts

I just started working with the Zend Framework. I've used CodeIgniter before so I'm familiar with MVC. My question is, how do I work with configuration data in a layout? I've created a layout and it works fine. I've also created a custom config.xml file in the configs folder, which holds data that will be used on the layout. Now on my layout, I have the following code which works.

$news = new Zend_Config_Xml('../application/configs/config.xml', 'news'); foreach($news->feed as $key => $feed) {	echo '<li class="feed" id="news_'.$key.'">'.$feed->name.'</li>';}

Creating this Zend_Config object probably shouldn't be in a view type of file. There is probably a more appropriate place to put it like a bootstrap, but I am not sure where. Any suggestions? Thanks!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...