PHP Classes

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

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 183 This week: 1All time: 8,674 This week: 571Up
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 is available for providing paid consulting. Contact Yerfry Ramirez .
Classes: 7 packages by
Country: Sweden Sweden
Age: ???
All time rank: 184018 in Sweden Sweden
Week rank: 420 Up5 in Sweden Sweden Up
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  
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  /  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  /  classes  
File Role Description
  Plain text file Class.Template.php Class Template Class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:183
This week:1
All time:8,674
This week:571Up