06-05-2012, 05:49 AM
[eluser]luismartin[/eluser]
I'm implementing a form to search for products. The variables to be managed are like these: "product_type", "product_collection" (two nested levels of categories), "search_term", "offset", "per_page" (the last ones to manage pagination).
I'm not sure how to do it: whether to send them through POST, which means same URL for different results (this might be SEO unfriendly), or through routed variables as segments in the URL, which in turn would act like parameters in the controller. This one looks rather ugly to me, because if this is the URL structure:
products/display/[product_type]/[product_collection]/[search_term]/[offset]/[per_page]
what if I only want to filter by term to search? I use to do something like:
products/display/0/0/term-to-search
What do you think is a better approach to this question?
I'm implementing a form to search for products. The variables to be managed are like these: "product_type", "product_collection" (two nested levels of categories), "search_term", "offset", "per_page" (the last ones to manage pagination).
I'm not sure how to do it: whether to send them through POST, which means same URL for different results (this might be SEO unfriendly), or through routed variables as segments in the URL, which in turn would act like parameters in the controller. This one looks rather ugly to me, because if this is the URL structure:
products/display/[product_type]/[product_collection]/[search_term]/[offset]/[per_page]
what if I only want to filter by term to search? I use to do something like:
products/display/0/0/term-to-search
What do you think is a better approach to this question?