Welcome Guest, Not a member yet? Register   Sign In
Using other controller to display a view
#2

[eluser]jedd[/eluser]
Hi sw, and welcome to the CI forums.

I think that rather than considering a view to be owned by another controller, as such, you might want to approach this from the authentication angle. That is, you'd test if the user was authenticated, and if they were not, you'd automatically send them off to the login page.

You can do that with the redirect command, so something like this in your code:

Code:
redirect ('auth/login');

That'll take them straight to the Auth controller, and the login method within same.

The line before that would probably be some test to see if you were already authenticated - this is usually a call to session data to see if a certain variable is set.

Is this the kind of thing you were thinking of?


Messages In This Thread
Using other controller to display a view - by El Forum - 04-02-2009, 06:31 PM
Using other controller to display a view - by El Forum - 04-02-2009, 06:53 PM
Using other controller to display a view - by El Forum - 04-02-2009, 07:17 PM
Using other controller to display a view - by El Forum - 04-02-2009, 07:37 PM
Using other controller to display a view - by El Forum - 04-02-2009, 09:29 PM
Using other controller to display a view - by El Forum - 04-03-2009, 04:35 AM
Using other controller to display a view - by El Forum - 04-03-2009, 12:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB