CodeIgniter Forums
Restricted context for resources - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Restricted context for resources (/thread-20574.html)

Restricted context for resources - El Forum - 07-14-2009

[eluser]Kenneth Allen[/eluser]
I am developing and application using CI and learning CI at the same time.

I get the URL approach based on resources, but I am still struggling with a facility within that structure.

If I have the hierarchy Season > Program > Team, where each of these is a separate resource. Then I can use a URL and controller for each and that is fine. When I view Teams I see ALL teams, and when I add a team I can add it to any Program.

I can even put a links on the Season list to permit me to view the Programs in that Season or to add a Program to that Season, but once the Program is added, it goes back to displaying a generic list of all Programs.

Is there a simple mechanism to 'remember' where the URL that brought me to the page that did the same or update and then go back to a restricted list rather than the list of all Programs? Or is there a way to pass the specific restriction along so that the redirect is aware of it?

I am hoping this is a case of overcomplicating things and I have lost sight of the trees for the thickness of the forest.

Restricted context for resources - El Forum - 07-14-2009

[eluser]Colin Williams[/eluser]
I think sessions are your best bet here. Just keep a session variable like "destination" then after and operation is complete, redirect() to that destination