-- monk.e.boy <[EMAIL PROTECTED]> wrote
(on Friday, 11 July 2008, 03:40 AM -0700):
>   Could someone explain the layouts in: app/views/layouts  what goes in
> here?
> 
>   Is it possible to have a layout per controller and one per application and
> one global that all work together?  The global one would have company logo,
> the application would have the app menu, and the controller would expand the
> app menu and have the options (links) for that controller. Is this sort of
> granularity possible?

Yes, though it will take a little work on your part.

Zend_Layout has two normal modes of operation: the 'startMvc()' syntax
creates an instance of Zend_Layout, registers it with a Plugin and an
Action Helper, and registers those with the MVC components. The other
mode, which is always available even when the MVC instance is in play,
is to use it as you would any other class -- simply instantiate it.

I'd recommend that you register the global layout with Zend_Layout in
your bootstrap, using the MVC notation:

    Zend_Layout::startMvc(...);

Then, you could create a postDispatch() plugin that would create an
instance of Zend_Layout using normal object syntax:

    $layout = new Zend_Layout(...);

>From there, you could inject the current content into that layout, and
then inject the rendered content back into the response object.

Finally, in your controller, you could also have a postDispatch() method
that does similarly as with the above plugin.


>   Kinda like multiple inheritance, so controller extends app, app extends
> global etc.. but these are layouts (phtml) so .... ?
> 
> Thanks for any insight :-)

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to