PHP Classes

PHP OOP Template Engine: Setup and process template with a fluent interface

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 183 All time: 8,686 This week: 560Up
Version License PHP version Categories
oop-template 0.1GNU General Publi...5.6.0PHP 5, Templates
Description 

Author

This class can setup and process template with a fluent interface.

It can load and process a template assigning template file to porcess and the variables to replace using a fluent interface of chained class calls.

The class can apply several template functions to values, like changing the case of the values, assign variable values within the template itself, loops, conditions, custom PHP code, etc..

Picture of Yerfry Ramirez
  Performance   Level  
Name: Yerfry Ramirez <contact>
Classes: 7 packages by
Country: Sweden Sweden
Innovation award
Innovation award
Nominee: 1x

Example

<?php
require_once 'config.php';
require_once
'Classes/Class.Template.php';

$Template = new Template();

$Template->setFile('test.html')
    ->
assign('Variable', 'mhm')
->
Output();


/** You can also do
    $Template->assign('Variable', 'mhm');

    $Template->setFile('test.html');
    $Template->Output(); // Or $Template->setFile('test.html')->Output();
**/
?>


  Files folder image Files (4)  
File Role Description
Files folder imagetemplates (2 files)
Files folder imageclasses (1 file)
Accessible without login Plain text file index.php Example Index page

  Files folder image Files (4)  /  templates  
File Role Description
  Accessible without login Plain text file test.html Aux. Example 1
  Accessible without login Plain text file mhm.html Aux. Example 2

  Files folder image Files (4)  /  classes  
File Role Description
  Plain text file Class.Template.php Class Template Class

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:183
This week:0
All time:8,686
This week:560Up