Best practice creating dynamic sidebar with zend framework

后端 未结 4 2054
情深已故
情深已故 2021-02-03 15:09

What is best practice to create dynamic sidebar or other non content layout places with zend framework. At this moment I created controller witch i called WidgetsController. In

4条回答
  •  梦谈多话
    2021-02-03 15:51

    You question doesn't provide many details. Generally, I'd say load the sidebar as view template, via the render/partial methods of the view. So from inside a view:

    //$data is dynamic data you want to pass to the sidebar
    echo $this -> partial('/path/to/sidebar.phtml',array('menuitems' => $data));
    

    And then sidebar could process that dynamic data:

    //sidebar.phtml
    
    

    If you need extra functionality, you could create a dedicated view helper to handle it.

提交回复
热议问题