We have taken on a site written in Zend framework. We didn’t write the site and haven’t use the Zend framework before so I’m interested in finding three things.
- How do I add new views to the site, adding in a new folder to the application/views/scripts directory seems to do nothing
- Are there any tutorials on how to add affiliate feeds and setups to a zend site that you can recomend?
- Are there any good tutorials on learning the framework? So far all I’ve found is vast amounts of material that confuses me
to answer your questions in order:
You have to find the controller, that will emerge the view you want to add. There are two ways to get a view script rendered. The first one is a naming convention on the view script. The view has to be the same name as the action name of the controller. Like ‘indexAction’ and index.phtml. The other way is to instanciate a view object within the controller and give a string with the view name at runtime. You may want to look at this excerpt:
$view = new Zend_View(); $view->a = ‘Hay’; $view->b = ‘Bee’; $view->c = ‘Sea’; echo $view->render(‘someView.php’);
which I took from http://framework.zend.com/manual/en/zend.view.controllers.html#zend.view.controllers.render
I don’t think that I understand what you mean by ‘affiliate feed’… are you talking about advertising or is it more like content syndication?
The first thing you should read may be the Zend Framework Study Guide which you find here: http://www.zend.com/community/downloads. There are many tutorials an howtos out there but, this guide is made from Zend directly and should cover the main topics.
Regards, Mario