Welcome Guest, Not a member yet? Register   Sign In
Load controller from another controller
#9

The correct way to do this is to have a global Model being loaded by autoload, and there you create a function that will perform the insertion of your header and footer, you can also send a parameter and use as embedding views.

public function loadLayout($view = null, $data) {
//Load your data here

$this->load->view('header', $data);
$this->load->view($view, $data);
$this->load->view('footer', $data);
}
Reply


Messages In This Thread
RE: Load controller from another controller - by lucasrohers - 06-21-2019, 06:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB