Welcome Guest, Not a member yet? Register   Sign In
Invoking a subset within a CI application
#13

[eluser]fijiaaron[/eluser]
If 'program' is 'juniors' then I see it as just another parameter to 'schedule'.

If I understand correctly, it seems like each case is actually an instance of an 'index' or 'view' method for 'schedule', though I'm a bit unclear about the expected behavior.

If what you want is to hide information in a session so the URL can be shorter, you could store parameters from previous requests in a cookie.

So my take:

A schedule is the model you're returning.
The parameters used to determine which schedule to return include:
season (e.g. Summer2009)
team (e.g. Buccaneers)
program (e.g. Juniors)
Are all parameters needed to identify a schedule?
Do you want to return a list of schedules that meet the criteria or options to select further parameters if a specific schedule isn't identified?

I agree with Colin that having 1 canonical URL for each resource is a good idea, but I also understand Kenneth wanting a more user-friendly interface. You could satisfy both by processing "shorthand" urls but forcing a redirect (though suffering a performance hit.)

REST is nice, but is only an opinion of how an API can be developed, not THE WAY THE WEB ACTUALLY WORKS. While you can't GET hidden form fields you could certainly POST information and also obtain parameters from the URL (though CodeIgniter doesn't really help you with that, except with a few helper functions like uri_to_assoc().)


Mapping routes for all the possible combinations could get tricky, and I wouldn't rely on matching like I did with 'season' in my example posted above. You could keep all parameters in order, or use uri_to_assoc() as Colin suggested, or implement your own URI parser (e.g, for named parameters http://my-site/schedule/season=summer200...am=juniors) or just use a good old fashion query string (e.g. http://my-site/schedule?program=juniors&...summer2009)


Messages In This Thread
Invoking a subset within a CI application - by El Forum - 06-13-2009, 04:35 PM
Invoking a subset within a CI application - by El Forum - 06-13-2009, 06:26 PM
Invoking a subset within a CI application - by El Forum - 06-13-2009, 06:29 PM
Invoking a subset within a CI application - by El Forum - 06-13-2009, 06:43 PM
Invoking a subset within a CI application - by El Forum - 06-13-2009, 07:00 PM
Invoking a subset within a CI application - by El Forum - 06-13-2009, 07:05 PM
Invoking a subset within a CI application - by El Forum - 06-13-2009, 07:29 PM
Invoking a subset within a CI application - by El Forum - 06-13-2009, 07:40 PM
Invoking a subset within a CI application - by El Forum - 06-13-2009, 08:02 PM
Invoking a subset within a CI application - by El Forum - 07-03-2009, 11:47 AM
Invoking a subset within a CI application - by El Forum - 07-03-2009, 01:06 PM
Invoking a subset within a CI application - by El Forum - 07-03-2009, 01:33 PM
Invoking a subset within a CI application - by El Forum - 07-03-2009, 03:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB