Jonathan Allard
Jonathan Allard

Reputation: 19249

Getting started with Phil Sturgeon's CodeIgniter Template library

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?

Upvotes: 6

Views: 5327

Answers (1)

No Results Found
No Results Found

Reputation: 102745

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.

Upvotes: 10

Related Questions