Call to a member function error - Codeigniter

382 views Asked by At

Everything is working as expected on my local server, but when I try to run it on my live server I get an error:

Fatal error: Call to a member function call_admin_login() on null in codeigniter HMVC

What am I possibly doing wrong?

Below is my code:

<?php

class Admin_login extends MY_Controller {

    public function __construct() {
        parent::__construct();

        //Check Login Status
        $logged_info = $this->session->userdata('logged_info');
        if ($logged_info != FALSE) {
            redirect(base_url('admin/view_products.html', 'refresh'));
        }

        //Load Model
        $this->load->model('admin_login_model', 'login_mdl');
    }

    public function index() {
        $data['title'] = 'Admin Login';
        $this->template->call_admin_login($data);
    }

<?php

class Template extends MY_Controller {

    public function __construct() {
        parent::__construct();
    }

    public function call_admin_master($data = NULL) {
        $this->load->view('admin_master_v', $data);
    }

    public function call_admin_login($data = NULL) {
        $this->load->view('admin_login_v', $data);
    }

}
0

There are 0 answers