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

[eluser]Unknown[/eluser]
Hello

My questions deals with code execution when calling redirect.

for example in a controller
Code:
function __construct()
{
    some code
    some more code
    redirect(valid args)
    code after redirect
}

does 'code after redirect' get executed?
does the controller action that was called get executed?

This is in relation to blocking access to certain controllers or actions based on whether or not a user is logged in, if they are not I want to prevent the actions from executing and redirect them to the login.

If this is not the proper way to accomplish this, can some one please guide me in the right direction.

Any help would be greatly appreciated.

Thanks
Sam
#2

[eluser]richthegeek[/eluser]
why don't you try it and find out?

for per-load authentication, you may want to investigate hooks.
#3

[eluser]Grahack[/eluser]
Hi dpdev, and welcome to CI.
I quite agree with php_penguin: testing by ourselves is the best way to know. You could even look in the url_helper what exactly this function does. That's REALLY interesting to know the internals of our framework.
My answer is: this can be a proper way, but hooks will catch things faster, preventing the framework to load useless libs.




Theme © iAndrew 2016 - Forum software by © MyBB