News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jani Hartikainen's Blog:
Handling errors in Zend Framework
March 03, 2009 @ 07:54:59

Jani Hartikainen has written up a new post looking at error handling in one of the more popular PHP frameworks - the Zend Framework.

In Zend Framework based applications, error handling is typically done using the error controller, but there are different ways to send the execution to it - some better than others. Let's look at some ways to trigger the error controller and how to have it handle different error conditions.

He walks through the steps to create the Error controller, change the front controller to use it and add in a few different kinds of actions to handle the various error types that might come up (like "page not found" or "not authorized"). Errors can then be forwarded to each of the actions by the resource the visitor errored from. Of course, he also mentions that exceptions can do something even better - handle the error without all of that messy forwarding around. (There's an example of that version too).

0 comments voice your opinion now!
handle error controller zendframework exception forward action


blog comments powered by Disqus

Similar Posts

Cal Evans' Blog: Things I learned about Zend Tool

Juozas Kaziukenas' Blog: SQL Native Client as MSSQL driver for Zend Framework

Vexxhost.com: Top 5 new (and cool!) features in PHP5 that you probably haven't heard of

SaniSoft Blog: Bugs & enhancements for Auth component in CakePHP v1.2 - Part 1

Zend Developer Zone: php|architect Announces 'Programming with the Zend Framework'


Community Events

Don't see your event here?
Let us know!


release podcast symfony2 opinion install extension php7 library voicesoftheelephpant version interview series conference api introduction performance laravel framework example community

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework