Saturday, January 07, 2017

template inheritance in codeigniter

hi,

when it comes to $this->load->view('view_file') in controller, usually i saw something like this.

$this->load->view('header');
$this->load->view('body', $data);
$this->load->view('footer');

its to maintain the design template that they create or use. for me, ill try to make my controller clean as possible. its easier for me in case i need to debug my code. so the code in my controller must be as minimal as it can be. only a form process and a few things that is very important should be there in the controller.

in order to do that, i need help from a helper which is

template inheritance
. u can download n study from this site.
http://www.phpti.com

pls do take note, its not the same as

Smarty template inheritance
because the file i meant was based on
Django project

u can get the file from this link.

template_inheritance_helper.php

enjoy!

No comments: