I want to generate a dynamic site using Zend_Layout.
My layout (/application/layouts/scripts/layout.phtml) contains the following lines:
...
I would also advise against using the action view helper. Unless you have a bunch of logic in your controller, you probably don't need to dispatch another request to another controller just to render a view partial.
I would recommend simply using a view partial just like you have done with your header.phtml and footer.phtml:
render('header.phtml') ?>
layout()->content ?>
render('auth/login.phtml') ?>
render('footer.phtml') ?>
And maybe your auth/login.phtml view script looks like this:
user)): ?>
Please log in
Hello user->name ?>
As long as you set your view variables at some point in your controller, you can call the render view helper from within a view (or even a controller if you wanted to).
#index controller
public function indexAction()
{
$this->view->user = Model_User::getUserFromSession();
}