From: Matthew Weier O'Phinney Date: Tue, 28 Feb 2012 18:06:10 +0000 (-0600) Subject: Updates to 404 handling X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=52b88520f430185d0a40076fdf5a4c33aa62602d;p=zf2.biz%2Fapplication_blanche.git Updates to 404 handling - Updated configuration settings - Updated 404 handler to display controller and exception, if present - Do not merge until all outstanding view layer PRs are merged on ZF2 master --- diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php index dd2f0d7..fd748ee 100644 --- a/module/Application/config/module.config.php +++ b/module/Application/config/module.config.php @@ -54,19 +54,20 @@ return array( ), 'Zend\Mvc\View\DefaultRenderingStrategy' => array( 'parameters' => array( - 'baseTemplate' => 'layout/layout', + 'layoutTemplate' => 'layout/layout', ), ), 'Zend\Mvc\View\ExceptionStrategy' => array( 'parameters' => array( 'displayExceptions' => true, - 'template' => 'error/index', + 'exceptionTemplate' => 'error/index', ), ), 'Zend\Mvc\View\RouteNotFoundStrategy' => array( 'parameters' => array( - 'notFoundTemplate' => 'error/404', 'displayNotFoundReason' => true, + 'displayExceptions' => true, + 'notFoundTemplate' => 'error/404', ), ), diff --git a/module/Application/view/error/404.phtml b/module/Application/view/error/404.phtml index aa5771d..468953f 100644 --- a/module/Application/view/error/404.phtml +++ b/module/Application/view/error/404.phtml @@ -26,8 +26,35 @@ switch ($this->reason) {

- + + +controller) && $this->controller): ?> + +
+
Controller:
+
escape($this->controller) ?> +controller_class) + && $this->controller_class + && $this->controller_class != $this->controller +) { + echo " (resolves to " . $this->escape($this->controller_class) . ")"; +} +?> +
+ + + +exception) && $this->exception): ?> + +

Exception:

+ +

escape($this->exception->getMessage()) ?>

+ +

Stack trace

-

No Exception available

+
+exception->getTraceAsString() ?>
+