STPL: Render templates using PHP code scripts

Recommend this page to a friend!
  Info   Example   View files (6)   Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 124 This week: 1All time: 9,123 This week: 261
Version License PHP version Categories
stpl 1.0.0BSD License7.2PHP 5, Templates
Description Author

This class can render templates using PHP code scripts.

It takes a given PHP script that mixes data and code that calls the class to outputs data that is inserted in placeholder positions of the template.

Currently it can replace placeholder positions with variable values taken from parameters passed as associative arrays or replace sections defined using the return values of callback function.

Picture of Aleksandar Zivanovic
  Performance   Level  
Name: Aleksandar Zivanovic <contact>
Classes: 15 packages by
Country: Serbia Serbia
Age: 26
All time rank: 17217 in Serbia Serbia
Week rank: 81 1 in Serbia Serbia
Innovation award
Innovation award
Nominee: 4x

  Files  
File Role Description
template (1 file, 2 directories)
index.php Example Entry file for example.
STPL.php Class Simple PHP template engine, without using any fancy custom syntax, it relies only on pure php and plain html

  Files  /  template  
File Role Description
pages (1 file)
partials (2 files)
   base.php Example Example script

  Files  /  template  /  pages  
File Role Description
   welcome.php Example Example script

  Files  /  template  /  partials  
File Role Description
   bottom.php Example Example script
   top.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:124
This week:1
All time:9,123
This week:261
User Comments (1)
A very helpful class for templating in core php
2 years ago (Dinesh Suthar)
70%
 

For more information send a message to info at phpclasses dot org.