News Feed
Sections




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

Alexander Netkachev's Blog:
404 error with Zend Framework Front Controller
March 15, 2007 @ 09:39:00

Alexander Netkachev has a new post to his blog that talks about a handy method he discovered when using the Zend Framework to help replace the default "invalid controller" message the Framework gives when hitting a location there's no action for.

A few days ago I noted a quick but very usefull tip on how to handle the situation when Front Controller is unable to dispatch the request, i.e. how to display 404 error page instead of Zend_Controller_Dispatcher_Exception with message "Invalid controller specified". And it looks like the common solution for this is to create a front controller plugin. The plugin detects whether the request is dispatchable and changes module/controller/action to appropriate action that will handle the request.

His solution uses a NoRoute controller to check and see if there is a valid controller for the requested action. If not, it routes them to a custom controller with a nicer error message. For those that want a bit more low level type of solution, he also includes how to modify the framework itself to perform the same action.

1 comment voice your opinion now!
zendframework 404error front controller noroute example zendframework 404error front controller noroute example


blog comments powered by Disqus

Similar Posts

ZendCasts.com: Creating Custom Application Resources

Sander van de Graaf's Blog: Optimizing your (ZF) web application

PHPImpact Blog: Improving the performance of Zend_Controller

Leonid Mamchenkov's Blog: PHP regular expression to match English/Latin characters only

Jamie Hammett's Blog: Open ID edit one page on Wordpress


Community Events

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


application framework series performance part2 example release podcast community library conference interview api laravel opinion symfony2 configure php7 introduction voicesoftheelephpant

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