Always use error layout when rendering error pages.

This commit is contained in:
ADmad 2012-03-31 12:42:17 +05:30
parent 6fa30db504
commit 3495422ac5
2 changed files with 6 additions and 1 deletions

View file

@ -56,7 +56,11 @@ class CakeErrorController extends AppController {
$this->constructClasses(); $this->constructClasses();
$this->Components->trigger('initialize', array(&$this)); $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)) { if (isset($this->RequestHandler)) {
$this->RequestHandler->startup($this); $this->RequestHandler->startup($this);
} }

View file

@ -150,6 +150,7 @@ class ExceptionRenderer {
$controller = new CakeErrorController($request, $response); $controller = new CakeErrorController($request, $response);
} catch (Exception $e) { } catch (Exception $e) {
$controller = new Controller($request, $response); $controller = new Controller($request, $response);
$controller->layout = 'error';
$controller->viewPath = 'Errors'; $controller->viewPath = 'Errors';
} }
return $controller; return $controller;