Creating a Template Helper for CodeIgniter

Posted by & filed under CodeIgniter, PHP.

As discussed in the previous post, a better way to load a template is by using a helper function, which loads the header and footer (and any common partials) for each page. Here’s how our template helper will be. Save the above code to application/helpers/template_helper.php file. To use the helper, we do the following in… Read more »

Basic templating with CodeIgniter

Posted by & filed under CodeIgniter, PHP.

A general website can be divided into 5 parts Header Content Area Left Sidebar Right Sidebar Footer When developing in CodeIgniter, we often have these parts saved as separate views and load them each time a page is loaded, like in the code below: Although this is a good process, it is surely tedious for… Read more »