CodeAngel.org
Faith in Knowledge.Search
Archives
Categories
Syndication
Custom Zend Framework Router
Saturday, June 30. 2007
One could tweak Zend Framework's Router_Route to meet almost all your routing needs. But what if you want something beyond what that package can offer? You can make your routing dreams come true with making your own custom router, all you need to do is implement Zend_Controller_Router_Route_Interface (that's a mouth full).
Case example, I needed a website that could have an arbitrary amount of hierarchal categories. I wanted my URI path to reflect the full path to that category. For example:
http://www.example.org/category/clothing/hats/dress/fedora
This URL would represent the category controller. Each category is a child of the category to the left of it, clothing being the top most parent.
RSS 1.0 Feed