[eluser]developer10[/eluser]
This is a huge problem for me in CI.
here's a detailed description (and if you'd like to see live version of the site i'm rebuilding using CI, visit the link in my signature).
Lets assume this is where and how i display data:
/controller/method/Category/ --> only 1 category is listed (a link from the left column is clicked)
/controller/method/Category/City/ -> only items from a particular category and from particular city are listed (this might be done using simple search form at the top)
/controller/method/Category/City/P/ -> same as above, STARTING with P
/controller/method/Category/City/P/4/ -> same as above, page 4
as the number of parameters increases, things get more tricky. the real problem is when one (or even worse, more) parameter(s) are missing, because i have to
set up my function to expect certain number of parameters. if some of them are missing, everything gets screwed up.
what's the best practice in CI for situation like this? how should function and query for returning results (based on given criteria) look like?
here's more possible forms of urls when browsing the site:
/controller/method/Category/P/ ---> only one category (no city specified), starting with P
/controller/method/City/4/ --> only city specified, page 4
as you can see, all has to be very flexible in terms of parameters supplied to the function.
hope all of this was clear, if not, ask and i'll try to be more specific!