Search code examples
model-view-controllerexceptionzend-framework2zend-view

ZF2 : disable error page layout


im trying to disable layout while showing error/exception page in my zf2 module

but nothing works

please help


Solution

  • Final Solution in my Module.php

    $eventManager = $e->getApplication()->getEventManager();
    
    
    
            $eventManager->attach(MvcEvent::EVENT_DISPATCH_ERROR, function($e) {
                 $result = $e->getResult();
                 $result->setTerminal(TRUE);
    
                });
    

    it works and only loads error/404 view file not the layout file

    thanks andrew