In Zend MVC, how do you pass a variable set int the controller, to a layout?

292 views Asked by At

I have to pass the page title names and meta information to the layout but not to sure how to do this =/

2

There are 2 answers

1
Vika On BEST ANSWER

You may set you page titles and other info in your controller (if you're planning to change these depending on the action called):

$this->view->headTitle('123');
$this->view->headMeta('text/html; charset=UTF-8', 'Content-Type', 'http-equiv');

And then render them in your layout:

echo $this->headTitle() . $this->headMeta();