How to load view from a different folder and pass it to the required view in codeigniter

81 views Asked by At

I have installed the tank_auth to help me out in the login but I'm using codeigniter for the first time. I have loaded the library and called the view as follows in the main controller:

public function index()
{


    $this->load->library('tank_auth');    
    $this->lang->load('tank_auth');
    $data['login_form'] = $this->load->view('auth/login_form', NULL, TRUE);
    $this->load->helper('form');
    $this->load->view('header');
    $this->load->view('nav');
    $this->load->view('login',$data);

    $this->load->model('posts');       
    $data['post'] = $this->posts->get_post();        
    $this->load->view('posts',$data);

}

Then I wanted to load the setup as offered by tank_auth, but on the UI that I have made on the login page. But for some reason it doesn't work and I just get a blank page. "auth" is a folder in the views directory where other view(xyz.php) files are stored. How can I solve this and use the same tank_auth library in the UI and views that I have created?

this is the code that I was using as reference

0

There are 0 answers