Jump to content

Zend Framework intro questions

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!

Edited by big dave

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...