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.