Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Simple template library with some core functionalities to simplify development process for CodeIgniter 2.x

License

Notifications You must be signed in to change notification settings

danieltorscho/CI_Template_lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CodeIgniter 2+ Simple Template Library

Simple template library with some core functionalities to simplify the development process for CodeIgniter 2.x.

How to use

  1. Extract all files to your project root directory. Make sure to overwrite all files if prompted.
  2. Open app/config/autoload.php, add 'template' to $autoload['libraries'] and $autoload['config'].
  3. Edit your template configuration file application/config/template.php.
  4. Navigate to yourwebsite.dev/index.php/welcome.

Template library handles most of the views logic on its own.

With simple $this->template->load(); call inside the controller's method, it will automatically create pagetitle, pagename, scripts, stylesheets variables and subload a corresponding subview file controller/method.php if nothing was provided in load() function.

Documentation

Load custom view file:
$this->template->load('path/to/view.php');

Load custom view file within a custom template file:
$this->template->load('template/login', 'user/login/form');

Set custom page title:
$this->template->title('Product page');

Set custom breadcrumbs:
$this->template->crumb('E-commerce', 'ecommerce/index');
$this->template->crumb('Products', 'ecommerce/products');
$this->template->crumb('Product #391');

Add custom JavaScript file loading:
$this->template->script('plugin/head.js', TRUE)
$this->template->script('footer.js');

Add custom CSS file loading:
$this->template->css('print.css', 'print');

Set custom variables:
$this->template->set_item('articles', $articles); // Now you are able to use $articles inside all subviews

About

Simple template library with some core functionalities to simplify development process for CodeIgniter 2.x

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages