If you are a beginner in CodeIgniter then you might be confused about how to use your favorite template in your application design. Because when loading views in CodeIgniter controller if you don't use templates then in all the views you might end up repeating the code for common views.
So here is a quick step by step guide on using templates with CodeIngiter views.
<html> <head> <title> <?php echo $title; ?> </title> </head> <body> <?php $this->load->view('header.php'); ?> <?php $this->load->view($content); ?> <?php $this->load->view('footer.php'); ?> </body> </html>
$data = array(); $data['title'] = 'My title'; $data['content'] = 'blog/view'; $this->load->view('template', $data);
That was easy. You can extend on this as per your requirement.