Stop execution after render in beforeFilter of CakePHP
Try:
$this->response->send();
$this->_stop();
I stumbled across this thread while trying to do the same thing. The accepted answer works but omits an important detail. I'm trying to render a layout (not a view) and I had to add an additional line to prevent the original request's view from throwing errors.
Inside AppController::beforeFilter()
:
$this->render(FALSE, 'maintenance'); //I needed to add this
$this->response->send();
$this->_stop();