Hi,
I'm trying to create a route that will "cover" this kind of URLs:
www.test.com/parent1/parent2/parent3/item
www.test.com/parent1/parent2/parent3/parent4/item1
Number of those parents in unspecified, and it should only serve to give a better, more intuitive look to site URLs. Main parameter is that "item".
I suppose that only way to solve that is to use Route_Regex, and so I tried to accomplish this route task with something like this:
routes.test.type = "Zend_Controller_Router_Route_Regex"
routes.test.route = "test/(?:.*)?([^\/]+)"
routes.test.defaults.module = default
routes.test.defaults.controller = test
routes.test.defaults.action = index
routes.test.map.1 = "path"
routes.test.map.2 = "item"
routes.test.reverse = "test/%s%s"
I haven't been testing this to much, because I'm not sure if I'm doing the right thing... I have no idea how that regex should even look like, and how should I treat that "path".
Can you advice what should I do to fulfill this kind of route demand? So, I need that path (parent1, parent2, etc.) only for appearance, and main param is that "item"...
Thanks,
Nikola