modified FrontController to get error layout from Router
This commit is contained in:
@ -41,8 +41,10 @@ class FrontController
|
||||
/**
|
||||
* Refuse cloning
|
||||
*/
|
||||
private function __clone(){}
|
||||
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return FrontController
|
||||
*/
|
||||
@ -126,14 +128,20 @@ class FrontController
|
||||
}
|
||||
}
|
||||
return $html;
|
||||
} catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
if (DEBUG == true) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.0 500 Internal Server Error');
|
||||
}
|
||||
return ErrorHandler::showDebug($e);
|
||||
}
|
||||
$layout = new ErrorLayout();
|
||||
$layout_class = $this->getRouter()->getErrorLayout();
|
||||
|
||||
/**
|
||||
* @var ErrorLayout $layout
|
||||
*/
|
||||
$layout = new $layout_class();
|
||||
$layout->setException($e);
|
||||
return $layout->fetch(new ErrorAction($e));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user