2017 © Pedro Peláez
 

library ci_template_lib

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

image

danieltorscho/ci_template_lib

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

  • Monday, May 15, 2017
  • by danieltorscho
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

CodeIgniter 2+ Simple Template Library

Simple template library with some core functionalities to simplify the development process for CodeIgniter 2.x., (*1)

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., (*2)

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., (*3)

Documentation

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

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

Set custom page title:br/ $this->template->title('Product page');, (*6)

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

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

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

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

The Versions

15/05 2017

dev-master

9999999-dev

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

  Sources   Download

The Requires

  • php >=5.2.4