Kohana v3 routes - multiple optional parameters

myosh

New Member
I'm setting up a search system which has urls eg. all parameters are optional and there are 15 possible params in total\[code\]http://example.com/search/key1-value/key2-value/key3-value/key13-value/key15-value\[/code\]Is there a better way to set up the route than this?\[code\]Route::set('search', 'search(/<param1>(/<param2>(/<param3>(/<param4>(/<param5>(/<param6>(/<param7>(/<param8>(/<param9>(/<param10>(/<param11>(/<param12>(/<param13>(/<param14>(/<param15>)))))))))))))))') ->defaults(array( 'controller' => 'search', 'action' => 'index',));\[/code\]I would then test for them in the controller and parse them to a neat array. Is there any way to specify a route with any number of optional /key-value/ parameters?EDITI noticed the request object has a nice parameter array already -- this leads me back to the Route::set question.. is there a way to phrase it allowing any number of parameters without the ugly \[code\]...(/<param14>(/<param15>))))))))...\[/code\] nesting?
 
Back
Top