I am new to using Codeigniter but I do have enough understanding on mvc structure and Codeigniter itself to do simple things like load views in the controller and auto load libraries e.c.t. But the issue im having is I have a header and footer view that I want to be loaded automatically every time I load a view file.
I have done some googling and a lot of suggestions are dated, or sometimes I simply dont understand the solution. I have made my header view and linked my css in it, and also created my footer view as well. So lets say I wanted to load the default welcome page like below:
public function index() {
$this->load->view('welcome_message');
}
I can load them manually like so:
public function index() {
$this->load->view('common/header');
$this->load->view('welcome_message');
$this->load->view('common/footer');
}
But what I would like is to just load the view like normal and have my header and footer loaded with it automatically, I understand this needs to be accomplished using a custom library with a template function of some sort, but again I dont know enough to just do that from scratch and was hoping perhaps someone could point me in the right direction.