On Sun, Oct 19, 2008 at 9:31 AM, till <[EMAIL PROTECTED]> wrote: > On Sun, Oct 19, 2008 at 7:25 AM, TimTowdi <[EMAIL PROTECTED]> wrote: > > > > I want all actions for my IndexController to work using only the action > name, > > and actually redirecting if the index controller name is used. So: > > http://example.com/index/sitemap/ > > Would actually issue a redirect to: > > http://example.com/sitemap/ > > > > > > However, I will have other controllers, and I want them to use both > > controller and action, so for the indexAction of AdminController: > > http://example.com/admin/ > > And for the loginAction of AdminController: > > http://example.com/admin/login/ > > > > How would this best be accomplished? > > Don't hold me responsible for typos, but ... > > $router->addRoute('sitemap', > new Zend_Controller_Router_Route('/sitemap', > array('controller' => 'index', 'action' => 'sitemap', 'module' => > 'default'))); > > That should go in your bootstrap, whereever you setup your routes.
I think he wants to know one routing recipe whereby all the actions in his index controller can be accessed as example.org/action instead of example.org/index/action. I have wondered the same thing but was afraid to ask :-) Though I could image an intelligent 404 handler but that doesn't seem the most efficient solution. -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness
