0

I have categorie Controller, with index action

I need that when I enter address .com/categorie/education it uses index action with parameter education .com/categorie/index/education

or redirect all actions to index ??

Charles
  • 50,943
  • 13
  • 104
  • 142
Edmhs
  • 3,645
  • 27
  • 39
  • http://codeutopia.net/blog/2007/11/16/routing-and-complex-urls-in-zend-framework/ found better answer – Edmhs Nov 08 '10 at 16:09

1 Answers1

1

How are your routes setup? Given the lack of information provided I have to assume that you are using an .ini file, this is how it would work:

; CATEGORIE
categorie.type = "Zend_Controller_Router_Route_Static"
categorie.route = "categorie"
categorie.defaults.controller = categorie
categorie.defaults.action = index

categorie_view.route = "categorie/:slug"
categorie_view.defaults.controller = category
categorie_view.defaults.action = view

Note, I did change it up a bit, as the index action, imo, should list all categories. This way you have a viewAction to list the individual categorie.

To have it as you requested I believe it would be something like:

; CATEGORIE
categorie.route = "categorie/:slug"
categorie.defaults.controller = categorie
categorie.defaults.action = index
Jim
  • 18,673
  • 5
  • 49
  • 65