6
It is possible to program the codeIgniter to load the template automatically without specifying the views at each call in the controller?
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 every call. I want to know if there is a way to call the views header, navbar and automatic footer.