Error Handling of Zend Framework

intro
This article introduces an error handling described in Programmer’s Reference Guide of Zend Framework(see the section 7.10.5.2).You can download the source code of this article from here.

1.Create Controllers
Create the file application/constorllers/ErrorController.php with the following content.

Create the file application/constorllers/IndexController.php with the following content.

2.Create View
Create the file application/views/scripts/error/error.phtml with the following content.

3.Check
Let’s access your web server(ex.http://localhost/), and check the error screen. If you’ve modified your error controller to log exception, please check the log file too.
History
Date Content
2008/4/3 Published
2008/4/15 404 error message is fixed

One Comment

  1. The bug to which the 404 error message was not correctly displayed was corrected.

Leave a Reply

Your email address will not be published. Required fields are marked *