Skip to content

View class for CodeIgniter to enable flexible layouts usage

Notifications You must be signed in to change notification settings

bigdaddymax/CIView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

CIView

View class for Code Igniter to enable flexible layouts usage.

###Usage

  • Simply put the View.php file into libraries/ directory of your project
  • add $this->load->library('View'); in your Controller's constructor
  • Create layout.php file in your views/ directory. This file must to contain $content variable - this is where your content will be inserted
  • Use $this->view->render('template_name', $data) instead of $this->load->view('template_name', $data) and your template_name will be inserted into layout automatically.
  • If for some reason you don't need a layout to be rendered just call $this->view->enable_layout(FALSE);
  • Also you can stack partial templates to construct final page by subsequent calls of $this->view->add_partial('template1'); and then simple $this->view->render(); without arguments
  • Basically, that's it

About

View class for CodeIgniter to enable flexible layouts usage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages