Welcome Guest, Not a member yet? Register   Sign In
having ready every last page url seamlessly - I hope it would be usefull for someone
#1

[eluser]jvicab[/eluser]
In my current project I needed to know the last page url to redirect to it and I would like to have a way of doing it without sending the current url to the next page everytime I need it, so I figured out a way that works fine. Now I have all the time the last page url in a session variable.

Maybe it would be helpfull for someone, so I decided to share it here.

All that is needed is having a bridge controller which extends CI_Controller and which all our controllers inherit from. In the bridge controller we declare a destructor and inside it we assign a session variable with the current_url value, basically setting it for the next server session. That way in every point of our application we will have the value of the last page url in that session variable.




Theme © iAndrew 2016 - Forum software by © MyBB