views:

437

answers:

2

I am working in the error controller of my default module but I have other modules/controllers that have errors. Their errors are sent to the default/error controllers but the layouts that are used are the ones from the module that threw the error. I want to only use the default modules layout for all errors.

+3  A: 
    <?php
    class ErrorController extends Zend_Controller_Action
    {
        public function init()
        {
            parent::init();
            $layout = Zend_Layout::getMvcInstance();
            // Set a layout script path:
            $layout->setLayoutPath('/path/to/you/default/module/layouts');
            // choose a different layout script:
            $layout->setLayout('foo');
        }
    }
SM
A: 

Why not use helper:

public function init()
{
     $this->_helper->layout->setLayout('front');
}

hmmm???