Welcome Guest, Not a member yet? Register   Sign In
Multi-param seach with segmented URIs
#1

[eluser]veggen[/eluser]
I am implementing a very common scenario of multi-parameter search, meaning that a user can search for an item based on different parameters (like price, description, category etc.) at once, but none of the parameters is necessary.
So a search like this would be valid:
price < 200 and description contains 'test'
or
category=games and price <300.

With classic GET request parameters, this is simple to do (one just picks up the values that are provided), but I have no clue how to do it using segmented URIs that CodeIgniter loves... I know I can forgo segmented URIs completely, but I'd rather not do it as this is the only scenario where I need query params.

This is a fairly common use-case so I presume someone has come up with a good way to implement it in CodeIgniter.

I'd be grateful for any idea...
#2

[eluser]veggen[/eluser]
[quote author="veggen" date="1289173160"]
This is a fairly common use-case so I presume someone has come up with a good way to implement it in CodeIgniter.[/quote]
Seems I was right Smile I just discovered the uri_to_assoc method that does exactly what I need.
Strange that not one of 25 viewers of this topic new that... Oh, well...




Theme © iAndrew 2016 - Forum software by © MyBB