how to refer one .phtml in the other views in Zend
am new in Zend framework.
I have one .phtml file, includes menus section. i need to add that .phtml file in to the views i.e views/script开发者_如何转开发s/index.phtml page.
how can refer that
please advice
thanks in advance
You can use the render
helper:
<?=$this->render('menu.phtml')?>
If you want to pass specific variables to the rendered script, use the partial
helper:
<?=$this->partial('menu.phtml', array("varname" => "value"))?>
The menu.phtml file must be in the search path, which usually is the path to the current module's scripts directory ( view/scripts ). You can either place the menu.phtml file in this directory, or add a directory to the search path using the addScriptPath() method on the view object.
Try this
echo $this->partial('path/file.phtml', 'ModuleName')
精彩评论