Welcome Guest, Not a member yet? Register   Sign In
dx_auth redirection problem
#1

[eluser]Paleleaves[/eluser]
Hi,

I'm checking if the user is not logged in or not in dx_auth library from a different controller. All libraries,helpers are loaded default.

Code:
if ( ! $this->dx_auth->is_logged_in())
        {

            $data["login_screen"] = $this->load->view("auth/login", "", TRUE); // auth/login ("auth" is a different controller and "login" is a function inside that controller
            
            $this->load->view('notlogin', $data);
        }

If not the user will go the login screen

Code:
$data["login_screen"] = $this->load->view("auth/login", "", TRUE);

and echo the $login_screen in "notlogin.php"


But it shows an error

Quote:Unable to load the requested file: auth/login.php

Why it's happening like this... Any idea Sad
#2

[eluser]predat0r[/eluser]
Why do you load two views?

..
{
$data['somevariable'] = 'somevalue';
$this->load->view('auth/login', $data);
}

if you use your own login screen (not the DX default) then load this view (php file) only
#3

[eluser]osci[/eluser]
@predat0r
I don't think he is calling a view. He is trying to call a method from another controller.

@Paleleaves
You can't run a controller from another controller. You would need a solution like HMVC, and you would do
Code:
$data['login_screen'] = modules::run('auth/login');




Theme © iAndrew 2016 - Forum software by © MyBB