I'm trying to create search filters that vary depending on object category. I need to show all of them in URL, even if it takes more than 255 chars and, to be honest, I'm lost.
I found 2 working examples: PC componentes
What I have done is to create 3 routes in order to pass an ad type, property type, state, locality and a district. The first 3 parameters are always required and in this cases I know exactly the params order:
tpl_search_adtype_type_state:
path: /{adType}-{propertyType}-{state}/page-{page}
defaults: { _controller: Bundle:Controller:action1, page: 1 }
tpl_search_adtype_type_state_locality:
path: /{adType}-{propertyType}-{state}/{locality}/page-{page}
defaults: { _controller: Bundle:Controller:action2, page: 1 }
tpl_search_adtype_type_state_locality_district:
path: /{adType}-{propertyType}-{state}/{locality}/{district}/page-{page}
defaults: { _controller: Bundle:Controller:action3, page: 1 }
An example route 1 would be: /rent-houses-madrid/
An example route 2 would be: /rent-houses-madrid/madrid/
An example route 3 would be: /rent-houses-madrid/madrid/city-center/
Now over these routes I need to add filter params like:
Route 1:
/rent-houses-madrid/min-price-100/max-price-5000/min-rooms-2/max-rooms-5/
But not all params should be there, another example would be:
/rent-houses-madrid/max-price-1000/min-rooms-2/min-toilets-2/
Any idea about how to achieve this in symfony2?
Thanks.