Zend Framework: Render multiple Views in one Layout

前端 未结 4 1036
终归单人心
终归单人心 2020-12-24 09:37

I want to generate a dynamic site using Zend_Layout.

My layout (/application/layouts/scripts/layout.phtml) contains the following lines:

...        
         


        
4条回答
  •  鱼传尺愫
    2020-12-24 10:02

    First advice is to avoid the Action view helper at all costs, it will probably be removed in ZF 2.0 anyway. (ZF-5840) (Why the actionstack is evil)

    This is related to a question I asked - and bittarman's answer is pretty useful. The best way to implement something like that is to have a view helper that can generate your "login" area. My_View_Helper_Login for instance. Then your layout can call $this->login(), and so can the view script for user/login. As far as having index/index render the content from news/list just forward the request to the other controller/action from the controller. $this->_forward('list', 'news');

提交回复
热议问题