Load controller from another controller |
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); } |
Welcome Guest, Not a member yet? Register Sign In |