Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting started with Phil Sturgeon's CodeIgniter Template library

Tags:

codeigniter

I'm trying to use Phil Sturgeon's CodeIgniter Template library, but I can't get it to change my pages. I read the documentation, followed the steps there,

  1. Download
  2. Copy to application folder
  3. Create a views/layouts/default view
  4. (Auto)load the library

however, it is not clear as to how the template is actually implemented. I thought that loading the view would apply the template everywhere, but it doesn't seem to work that way. I've also read about it in the CodeIgniter Wiki, but it looked too complicated to be the right answer.

How are you supposed to use Phil Sturgeon's Template with your controllers? (or views?) Am I missing something here?

like image 403
Jonathan Allard Avatar asked Apr 27 '11 22:04

Jonathan Allard


1 Answers

It does not overload the load->view() methods, that would be bad. You need to update your controllers to use the template's syntax and methods in every instance you want to use it:

http://philsturgeon.co.uk/demos/codeigniter-template/user_guide/

You will use $this->template->build() instead of $this->load->view() in most cases, after constructing your template by defining regions, setting titles, etc.

There should have been a user guide included in your download with examples.

like image 137
Wesley Murch Avatar answered Nov 11 '22 02:11

Wesley Murch