In my admin module, in the index controller i have multiple filtering options. The filtering is pretty simple done, based on the parameters, ie:
http://www.site.com/admin/pages/by/date_added/order/asc
-> This orders the pages by "date_added" ascending
http://www.site.com/admin/pages/status/published
-> This shows only the pages with status "published"
http://www.site.com/admin/pages/category/cars
-> This show only the pages under the "cars" category.
Then in my application bootstrap I have built the route like this:
$route = new Zend_Controller_Router_Route_Regex("^admin/pages/status/([a-z,_]+)$",
array(
"module" => "admin",
"controller" => "pages",
"action" => "index"
),
array(
1 => 'by',
2 => 'order',
)
);
$router->addRoute("admin/pages/order", $route);
The thing is that i don't know how to combine all these parameters but also to make them optional. For example i wan't to have links like this:
http://www.site.com/admin/pages/by/date_added/order/asc/category/cars
or...
http://www.site.com/admin/pages/category/cars/status/published