Permalink
Browse files

Always use error layout when rendering error pages.

  • Loading branch information...
1 parent 6fa30db commit 3495422ac5bde8667becaa1e4afc12c9d139c69b @ADmad ADmad committed Mar 31, 2012
Showing with 6 additions and 1 deletion.
  1. +5 −1 lib/Cake/Controller/CakeErrorController.php
  2. +1 −0 lib/Cake/Error/ExceptionRenderer.php
@@ -56,7 +56,11 @@ public function __construct($request = null, $response = null) {
$this->constructClasses();
$this->Components->trigger('initialize', array(&$this));
- $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
+ $this->_set(array(
+ 'cacheAction' => false,
+ 'viewPath' => 'Errors',
+ 'layout' => 'error'
+ ));
if (isset($this->RequestHandler)) {
$this->RequestHandler->startup($this);
}
@@ -150,6 +150,7 @@ protected function _getController($exception) {
$controller = new CakeErrorController($request, $response);
} catch (Exception $e) {
$controller = new Controller($request, $response);
+ $controller->layout = 'error';
$controller->viewPath = 'Errors';
}
return $controller;

0 comments on commit 3495422

Please sign in to comment.