The Template library helps your build complex views with CodeIgniter. It has logic to work with themes & modules and helps add your title, meta-data, breadcrumbs and partial views.
Template is released under the "Don't Be a Dick Public License", which you can read in all its glory here: http://philsturgeon.co.uk/code/dbad-license
- Download the latest version: http://github.com/philsturgeon/codeigniter-template/zipball/master
- Copy the files from this package to the correspoding folder in your application folder. For example, copy Template/config/template.php to application/config/template.php.
You load Template just link any other library:
You can also autoload the library.
To change configuration options simply edit the application/config/template.php file.
Edit the template $config array as needed:
- $config['parser_enabled'] - When set to TRUE this will use the Parser library.
- $config['parser_body_enabled'] - The parser can be enabled for the layouts but disabled for the body view files by setting this to FALSE.
- $config['title_separator'] - What string should be used to separate title segments sent via $this->template->title('Foo', 'Bar');.
- $config['theme'] - Which theme should be used by default, empty for none.
- $config['theme_locations'] - Store your themes in many places, similar to the way "Application Packages" are used.
NOTE: You can only use the Parser if you have also installed a Parser extensions like codeigniter-dwoo. This is because CI_Parser does not play nicely with arrays.