Robin, I had the same issue as the original poster and found your plugin
solution helpful.  However, when using AjaxContext, the plugin had the
effect of re-enabling the layouts disabled by AjaxContext, so instead of
writing the code to the postDispatch method, I used preDispatch and it seems
to be working so far.

Cheers,
Jeff


Robin Skoglund wrote:
> 
> I'd consider writing a postDispatch plugin, so you know what module you're
> actually dispatching. Something like:
> 
> class My_Controller_Plugin_ModuleLayout extends
> Zend_Controller_Plugin_Abstract
> {
>     public function postDispatch(Zend_Controller_Request_Abstract
> $request)
>     {
>         $layout = Zend_Layout::getMvcInstance();
>         $module = $request->getModuleName();
>         $layout->setLayout($module);
>     }
> }
> 
> Then in your bootstrap you do $front->registerPlugin(new
> My_Controller_Plugin_ModuleLayout()).
> 
> Of course, you could also do something more specific, e.g. limiting to
> only
> a few layouts and use a switch-case. Endless possibilites. This should
> also
> be a quite portable way of doing things.
> 
> Robin
> 
> On Wed, Apr 23, 2008 at 8:09 PM, rollockg <
> [email protected]> wrote:
> 
>>
>> Is there a way to define in my bootstrap a separate layout path for each
>> module?
>> --
>> View this message in context:
>> http://www.nabble.com/Alternate-layouts-by-module-tp16834740p16834740.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Alternate-layouts-by-module-tp16834740p22205935.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to