Using Template in Codeigniter 3

This tutorial will show you an example on how to use template in Codeigniter. In an web application a template is recommended because there are certain regions or areas which are common to all pages and only the body portion of the page gets changed. Common areas like header, footer, left sidebar or right sidebar are mainly common areas for most of the web applications. So we will fix those common areas in the template file so that every page will use those common areas in the application and body portion of each page will contain content which is specific to the page.

We will use here Colin Williams template library to demonstrate the template system in Codeigniter. Now-a-days the Williams Codeigniter Template library is no longer being supported or improved, the last version produced was 1.4.1. So to make it work with Codeigniter I have done a little modification to it.

We will use here the same application as I have shown in but the only thing change here is I will use Template library instead of loading the view file.

If you want to use Template library with Codeigniter 2 then you can read Continue reading “Using Template in Codeigniter 3”