mardi 5 mai 2015

Route and pass multiple keys with multiple values in urls

I currently give the opportunity to my website's users to select a list of products based on one value in one category. I use the RouteCollection class for the url to look better.

ex: value 'red' in category 'colour' which gives 'http://ift.tt/1QkLAUj'

I would like to offer the opportunity to make searches with more parameters with check boxes to ...check.

ex: 'red' in colour and '33cl' for the volume which gives 'http://ift.tt/1zzfyQa'

I think I can handle that quite easily and find a solution by myself. My issue comes with the fact that I would like to keep my routing policy with more than one value by key.

ex: 'red' and 'white' in 'colour' and '33cl', '75cl', '2l' in 'volume'. The expected result should look like this: 'http://ift.tt/1QkLD2o' or 'http://ift.tt/1zzfyQe'

Can you tell me how to form the url while clicking on the search button after having checked the desired values and how to handle the url in order to make some requests on the database?

Aucun commentaire:

Enregistrer un commentaire