I am a novice as far as writing Zend routers are concerned. I want to route all requests of the form
/:username to controller=>user and action=>profile. The catch is that I want to able to filter which :username will be routed. i.e. I want to filter the usernames will be routed.
The most basic and important filter that I want to apply, is that if the :username matches some existing controller name, it should not get routed to /user/profile.
Any help on this would be deeply appreciated. Thanks.
Here are some hints that should get you to where you want to be:
NOTE: If you go with option #3, the following should get you started:
$router = Zend_Controller_Front::getInstance()->getRouter();
$matchedRoute = $router->getCurrentRouteName();
You would take action based on the route name. If it isn't the route name that defines the /:username route, then ignore. If it does match, look up the username and filter.