[eluser]nuwanda[/eluser]
Jeff Way's screencasts on Nettuts are great.
I do this in my controllers:
Code:
$this->data['content']='user/login_form_view';
$this->load->vars($this->data);
$this->load->view('template');
Then in the template which is just a normal view:
Code:
$this->load->view('common/header');
$this->load->view($content);
$this->load->view('common/footer');
So, for every page the header and footer are the same (common). But the content is dynamic according to
the needs of the controller.
You can cascade this on and on since views can be loaded from views and all of the data set in the controller is available to all views. There's no need for any complex templating.
For instance, you could reference a sidebar in your controller and then display it in your content view.
All of the data ($this->data) that gets loaded is available to all views.