Thursday, October 6, 2011

Best practice? Building a search string with multiple options

Hi,

I have a search where you can select various filters.
I wonder how I should build the params to pass them to the search
function.

I currently use this way:

/search/cat:x/ => category:id
/search/city/ber:x or /cityreg/x => city/suburb:id
/search/price:x/ => price:from value
/search/ref:x/ => search for a reference number

My question now is: Is this ok? But depending on the user he can
select these options in a un-sorted order, so I never now and what
place is which param - (the user can select just one filter or all 4)
means I have to work with regex to find the right string and value.

Or is there a better, easier way?
I look forward to learn from you guys!!

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: