Welcome Guest, Not a member yet? Register   Sign In
dynamic function redirect
#1

[eluser]nevsie[/eluser]
to use a generic example...

i have a controller for category and a controller for products. Inside each there is the typical view list, delete, edit, etc.

I then have an overview controller that displays a list of categories with a sub set of products in each category. nice and simple and a typical scenario...

However, from this overview page i want to be able to edit the category, and edit / delete the products. I know i can create a link to the individual controllers and functions to edit or delete (e.g. /product/edit/ or /product/delete/)... but the problem is that at the end i want to redirect back to the page i came from (controller i came from).

now from reading and thinking it occurs to me that on pages that i want to return to, i.e. the overview page i could write the controller value to a session, then refer to that. but i would have to do this manually each time as i could not do it automatically on each page as it would be overwritten on the edit page...
Therefore... i can forsee there must be an easier way to do this... but its late and my mind is not switched on!

I originally was surprised to see that the previous URI was not held by CI and usable on the next page... unless i am missing something! can anyone suggest a tip or advice here?




Theme © iAndrew 2016 - Forum software by © MyBB