如何在CodeIgniter中的方法中加载控制器构造函数的视图?

I'm fairly new to CI and am trying to redirect a user to a view, with my own data, from a method inside a controller, like so:

class Welcome extends CI_Controller {

    public function doLogin() {
        extract($_POST);
        $this->load->library("form_validation");
        $this->form_validation->set_rules('email', 'Email', 'required|trim|valid_email');
        $this->form_validation->set_rules('password', 'Password', 'required|trim');
        if ($this->form_validation->run() == FALSE)
        {
            exit;
        }
        else {
            if ($this->welcome_model->loginuser($email,$password)==true) {
                header("Location: ".base_url()."explore");
            }
            else {
                $data['errors'][] = "Email and password do not match.";
                $this->load->view('header');
                $this->load->view('welcome',$data);
            }
            return true;
        }
    }
}

As you can see the lower part is supposed to load /welcome, but instead loads /welcome/doLogin

Is there a way to load the view like the constructor? so it will load /welcome only?

You are currently using welcome/doLogin to load view and you want that how to load (view) / doLogin by just visiting welcome .

To do so,

public function index(){
     $this->doLogin();
}

By using this funtion. Whenever you will open welcome page it will redirect you to doLogin() function automatically.