Gosh, sometimes one has to ask a question to find an answer himself...
Two minutes after I posted the topic, I found an explanation here:
Per Module Zend_Layout | Views From The Hill
You can do it by calling
[PHP]$layout = Zend_Layout::getMvcInstance();[/PHP]
in your plugins preDispatch() function and then you can do something like this:
[PHP]
<?php
class Custom_Plugin_Dispatcher extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$module = $request->getModuleName();
$controller = $request->getControllerName();
$action = $request->getActionName();
$layout = Zend_Layout::getMvcInstance();
switch ($controller) {
case 'index':
// use default layout specified in your bootstrap
break;
case 'ajax':
$layout->setLayout('ajax');
break;
case 'error:
$layout->setLayout('error');
break;
default:
$layout->disableLayout();
break;
}
}
public function postDispatch(Zend_Controller_Request_Abstract $request)
{
}
}
?>
[/PHP]