Is it possible to program codeIgniter to load the template automatically without having to specify the views for each call in the controler?
Example
user controller
public function listar() {
$this->load->view('template/header.php');
$this->load->view('template/navbar.php');
$this->load->view('template/principal.php');
$this->load->view('template/footer.php');
}
sales controller
public function listar() {
$this->load->view('template/header.php');
$this->load->view('template/navbar.php');
$this->load->view('template/principal.php');
$this->load->view('template/produtos.php');
$this->load->view('template/footer.php');
}
It is noticed that there is a code repetition for each call. I want to know if there is a way to call the header, navbar, and automatic footer views.