Moving pages/404.phtml rendering (in case of 404 errors) to error/404.phtml
authorMarco Pivetta <ocramius@gmail.com>
Wed, 23 Nov 2011 22:53:11 +0000 (23:53 +0100)
committerMarco Pivetta <ocramius@gmail.com>
Wed, 23 Nov 2011 22:53:11 +0000 (23:53 +0100)
module/Application/src/Application/View/Listener.php
module/Application/views/error/404.phtml [new file with mode: 0644]

index 275736d..71ea50b 100644 (file)
@@ -97,7 +97,7 @@ class Listener implements ListenerAggregate
             $response->setStatusCode(404);
         }
 
-        $script     = 'pages/' . $page . '.phtml';
+        $script     = 'error/' . $page . '.phtml';
 
         // Action content
         $content    = $this->view->render($script);
@@ -175,7 +175,7 @@ class Listener implements ListenerAggregate
             'display_exceptions' => $this->displayExceptions(),
         );
 
-        $content = $this->view->render('pages/404.phtml', $vars);
+        $content = $this->view->render('error/404.phtml', $vars);
 
         $e->setResult($content);
 
diff --git a/module/Application/views/error/404.phtml b/module/Application/views/error/404.phtml
new file mode 100644 (file)
index 0000000..cf9b486
--- /dev/null
@@ -0,0 +1,14 @@
+<h1>An 404 error occurred</h1>
+<h2><?php echo $this->message ?></h2>
+
+<?php if (isset($this->exception)): ?>
+
+<h3>Exception information:</h3>
+<p>
+    <b>Message:</b> <?php echo $this->exception->getMessage() ?>
+</p>
+
+<h3>Stack trace:</h3>
+<pre><?php echo $this->exception->getTraceAsString() ?></pre>
+
+<?php endif ?>