Getting Started with Phil Sturgeon CodeIgniter Template Library

I am trying to use the Sturgeon CodeIgniter Template file library , but I cannot force it to change my pages. I read the documentation by following the steps there,

  • Download
  • Copy to application folder
  • Create the views/layouts/ default view
  • (Auto) library download

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

How should you use the Phil Sturgeon pattern with your controllers? (or glances?) Did I miss something?

+6
source share
1 answer

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

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

In most cases, you use $this->template->build() instead of $this->load->view() , after creating your template, defining regions, setting headers, etc.

The examples should include the user guide included with your download.

+10
source

Source: https://habr.com/ru/post/886841/


All Articles