CodeIgniter Forums

Full Version: Restricted context for resources
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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.

El Forum

[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