Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I include header and footer with layout in Zend Framework?

I would like to let Zend_Layout include header.phtml and footer.phtml with [layouy name].phtml.

How do I do that? I tried to read codes in Zend_Layout, Zend_Layout_Controller_Plugin_Layout. I still can't figure out it..

like image 932
Moon Avatar asked Oct 26 '09 23:10

Moon


1 Answers

You could include your header and footer files from within your layout.phtml file. Here's an example:

<div id="header"><?= $this->render('layouts/header.phtml') ?></div>
<div id="nav"><?= $this->render('layouts/nav.phtml') ?></div>
<div id="content"><?= $this->layout()->content ?></div>
<div id="footer"><?= $this->render('layouts/footer.phtml') ?></div>
like image 160
Corey Ballou Avatar answered Sep 18 '22 12:09

Corey Ballou