2 added 165 characters in body
source | link

Something I use most of the time, is just three (or more) views in the controller, like this:

class Mycontroller extends CI_Controller {
    public function index() {
        $headerData['title'] = 'Title of the page';
        $yourData['content'] = 'Everything you want to do inside your controller';

        $this->load->view('template/header',$headerData);
        $this->load->view('template/page',$yourData);
        $this->load->view('template/footer');
    }
}

This way you can also set, for example, a title in your header file.

edit: you can extend this with, for example, menu views or something to keep things even more seperated. Just make sure that you load the views in correct order.

Something I use most of the time, is just three (or more) views in the controller, like this:

class Mycontroller extends CI_Controller {
    public function index() {
        $headerData['title'] = 'Title of the page';
        $yourData['content'] = 'Everything you want to do inside your controller';

        $this->load->view('template/header',$headerData);
        $this->load->view('template/page',$yourData);
        $this->load->view('template/footer');
    }
}

This way you can also set, for example, a title in your header file.

Something I use most of the time, is just three (or more) views in the controller, like this:

class Mycontroller extends CI_Controller {
    public function index() {
        $headerData['title'] = 'Title of the page';
        $yourData['content'] = 'Everything you want to do inside your controller';

        $this->load->view('template/header',$headerData);
        $this->load->view('template/page',$yourData);
        $this->load->view('template/footer');
    }
}

This way you can also set, for example, a title in your header file.

edit: you can extend this with, for example, menu views or something to keep things even more seperated. Just make sure that you load the views in correct order.

1
source | link

Something I use most of the time, is just three (or more) views in the controller, like this:

class Mycontroller extends CI_Controller {
    public function index() {
        $headerData['title'] = 'Title of the page';
        $yourData['content'] = 'Everything you want to do inside your controller';

        $this->load->view('template/header',$headerData);
        $this->load->view('template/page',$yourData);
        $this->load->view('template/footer');
    }
}

This way you can also set, for example, a title in your header file.