Sending variables to the layout in Zend Framework

后端 未结 8 1640
[愿得一人]
[愿得一人] 2020-11-28 06:45

In my project I have a number of dynamic elements that are consistently on every page. I have put these in my layout.phtml

My question is: How can I send variables i

8条回答
  •  甜味超标
    2020-11-28 07:42

    Without using helpers or plugins do :

    Zend_Layout::getMvcInstance()->assign('whatever', 'foo');
    

    After this you can use the following in your layout:

    layout()->whatever; ?>
    

    This will print "foo".

提交回复
热议问题