News Feed
Sections




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

Robert Basic's Blog:
Playing with Zend_Navigation and routes
August 10, 2009 @ 08:13:12

In this new post to his blog Robert Basic looks at the Zend_Navigation component of the Zend Framework and how it can be used to more correctly handle bad requests.

I wanted to set up routes in such way that when a user requests a page, all requests for non-existing controllers/modules are directed to a specific controller (not the error controller). In other words, if we have controllers IndexController, FooController and PageController, anything but http://example.com/index and http://example.com/foo is directed to the PageController.

Using the Zend_Controller_Router_Route_Regex component he creates an expression that matches anything but the two allowed controllers and pushes them back over to the "page" controller. The new route is put in place via an addRoute call. He also shows how to use the Zend_Navigation component to manage the navigation structure for this application, defining a PHP array of the nested sitemap if the site.

0 comments voice your opinion now!
zendnavigation route regex tree


blog comments powered by Disqus

Similar Posts

Expirmentalworks.net: Inofficial PHP GIT repositories - Importing large trees

PHP-GTK Community Site: Building a submenu in a GtkMenubar

Wenbert Del Rosario's Blog: Zend Framework: Making the Built-in Breadcrumb Helper Work

Derick Rethans' Blog: eZ Components 2007.2alpha1

Zend Developer Zone: PHP Security Tips #8 & #9


Community Events

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


laravel5 release example introduction library podcast series api unittest php7 laravel opinion voicesoftheelephpant framework interview video community extension version language

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