How to pass one .phtml in other views in Zend

I am new to Zend.

I have one .phtml file containing a menu. I need to add this .phtml file to the views ie views / scripts / index.phtml page.

how can you refer to this

consult

early

+3
source share
2 answers

You can use the helper render:

<?=$this->render('menu.phtml')?>

If you want to pass certain variables to the displayed script, use the helper partial:

<?=$this->partial('menu.phtml', array("varname" => "value"))?>

menu.phtml , (view/scripts). menu.phtml , addScriptPath() .

+2

echo $this->partial('path/file.phtml', 'ModuleName')
0

Source: https://habr.com/ru/post/1787127/


All Articles