Getting the hang of CodeIgniter - Templating / loading views
Posted
by
kilrizzy
on Stack Overflow
See other posts from Stack Overflow
or by kilrizzy
Published on 2010-11-10T15:42:37Z
Indexed on
2012/12/07
23:05 UTC
Read the original article
Hit count: 163
Attempting to learn CI and going through the docs to get a better understanding. Without getting a separate library, I could make a template by including a list of views like so:
$this->load->view('header');
$this->load->view('navigation');
$this->load->view('sidenav_open');
$this->load->view('blocks/userinfo');
$this->load->view('blocks/stats');
$this->load->view('sidenav_close');
$this->load->view('content',$data);
$this->load->view('footer');
This makes sense but would I actually have that on each of my controllers (pages)? Not sure if there is a way to include this in the initial controller (welcome) and then in the others somehow reference it? Or perhaps there is something I am missing completely
© Stack Overflow or respective owner