One of the biggest drawbacks of a framework is the absence of built in theming functionality. CodeIgniter is no exception to that rule. Although there are quite a few libraries out there which aim to provide theming support, they don’t feel like being part of the framework. I was annoyed with having to use anything which looks like an ugly hack so I created a library which supports themes in CodeIgniter in a native style.
First of all let’s see how this baby works:
Yes that was all. It is that simple.
Structure of your files
In the same path as your application folder create a theme folder and inside it a folder with the theme’s name. Also create a folder with the theme’s name inside views.
Inside the download you will see how the demo theme is structured.
Bonus: Caching control
$config['cjsuf'] = '0.1';
When you change that version to say 0.2, browsers will be forced to reload them since they think it is a different file.
Inside the download there is a demo theme to get you started