PHP Classes
elePHPant
Icontem

H2OTpl: Process and output PHP template scripts

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files Example   Screenshots Screenshots   View files View files (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2015-01-22 (1 year ago) RSS 2.0 feedNot yet rated by the usersTotal: 163 All time: 7,855 This week: 1,150Up
Version License PHP version Categories  
h2otpl 2.1GNU Lesser Genera...5.2PHP 5, Templates
Description Author  

This class can process and output PHP template scripts

It can process a given template PHP script by including it and capturing its output.

The template can access the template variables using $this, as the template variables are class variables.

It supports all the constructs of PHP like loops, conditional sections, including external files, etc..

The template output can be compressed by removing HTML comments and whitespace. The final processed output can be cached in local files to avoid template reprocessing overhead.

Picture of Pierre-Henry Soria
Name: Pierre-Henry Soria <contact>
Classes: 9 packages by
Country: ???
Age: ???
All time rank: 898
Week rank: 449 Up

Details  

H2OTpl - PHP Template Engine

Description

“The simplest and best way to separate your HTML (template) code from your PHP code while coding in PHP!”

H2OTpl is an easy, fast and secure PHP template engine.

It was created for my H2O Engine (framework), but now I have decided to create a standalone version for people who don't want to use it with my H2O framework.

My other Web Template Engines

  1. PHXSLT is a XSLT Template Engine for PHP.
  2. PH7Tpl There is not standalone version available. pH7Tpl is integrated into my pH7Frameowork. It supports two different syntaxes. The first looks slightly to Smarty syntax and the second is inspired to XSLT/XML syntax but simplified and easier to use.

Server Requirements

H2OTpl class can work with PHP 5.2, but not the demo. So, I recommend to have PHP 5.4 or higher installed.

Author

Pierre-Henry Soria

Contact

You can contact me at: ph7software {AT} gmail {DOT} com

License

This script is under Lesser General Public License (LGPL); See the LICENSE.txt file for more information.

Screenshots  
  • H2OTpl-Exemple
  Files folder image Files  
File Role Description
Files folder imagedemo (1 file, 3 directories)
Accessible without login Plain text file CHANGES-LOG Data Auxiliary data
Plain text file H2OTpl.class.php Class Class source
Accessible without login Plain text file LICENSE.txt Lic. Documentation
Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files  /  demo  
File Role Description
Files folder imagecache (1 file)
Files folder imagelibs (1 file)
Files folder imagetemplates (1 file, 2 directories)
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  demo  /  cache  
File Role Description
  Accessible without login Plain text file home.cache.php Output Cache output file

  Files folder image Files  /  demo  /  libs  
File Role Description
  Accessible without login Plain text file H2OTpl.class.php Example Example script

  Files folder image Files  /  demo  /  templates  
File Role Description
Files folder imageinc (2 files)
Files folder imagestyle (2 directories)
  Accessible without login Plain text file home.tpl.php Aux. Example script

  Files folder image Files  /  demo  /  templates  /  inc  
File Role Description
  Accessible without login Plain text file footer.tpl.php Aux. Example script
  Accessible without login Plain text file header.tpl.php Aux. Example script

  Files folder image Files  /  demo  /  templates  /  style  
File Role Description
Files folder imagecss (1 file)
Files folder imageimg (1 file)

  Files folder image Files  /  demo  /  templates  /  style  /  css  
File Role Description
  Accessible without login Plain text file common.css Data Sample output

  Files folder image Files  /  demo  /  templates  /  style  /  img  
File Role Description
  Accessible without login Image file HTML5.png Icon Icon image

 Version Control Unique User Downloads Download Rankings  
 92%Total:163All time:7,855
 This week:0This week:1,150Up