I want to generate a dynamic site using Zend_Layout.
My layout (/application/layouts/scripts/layout.phtml) contains the following lines:
...
<body>
<?php echo $this->render('header.phtml') ?>
<div id="content"><?php echo $this->layout()->content ?></div>
<?php echo $this->render('footer.phtml') ?>
</body>
...
If i browse to my index controller index action - Zend renders the index view (application/views/scripts/index/index.phtml) inside of $this->layout()->content automatically.
Now i want to render the views of to different controller actions in the layout. So i generate a new controller auth with an action login that shows a login form.
I change my layout to:
...
<body>
<?php echo $this->render('header.phtml') ?>
<div id="content"><?php echo $this->layout()->content ?></div>
<div id="login"><?php echo $this->layout()->login ?></div>
<?php echo $this->render('footer.phtml') ?>
</body>
...
When i browse to index/index, i want to define in this action that zend should render auth/login view inside $this->layout()->login and for example news/list inside of $this->layout()->content.
index/index is than a kind of a page layout - and auth/login and news/list a kind of widget
How to do this?