Login   Register  
PHP Classes
elePHPant
Icontem

XTemplate

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of barnabás debreceni  >  XTemplate  >  Download .tar.gz .zip  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: XTemplate
Base name: xtemplate
Description: Template engine for PHP
Related classes: , , , , , , ,
Version: -
PHP version: -
License: Unspecified (ask the author)
All time users: 4711 users
All time rank: 458
Week users: 0 users
Week rank: 2356
 

  Author  
Picture of barnabás debreceni
Name: barnabás debreceni <e-mail contact>
Packages: 1 Browse all classes by barnabás debreceni Browse all classes by
Country: Hungary Hungary - PHP jobs in Hungary
Age: ???
All time rank: 5094 in Hungary Hungary
Week rank: 2217 Down19 in Hungary Hungary Down


  Detailed description  
Template engine for PHP that allows to store your html code apart from your php code. It was tested with php 3.0.11.

It features:

- Simple variable interpolation ( {STUFF} )
- Array variable interpolation for eg. {ROW.ID} {ROW.NAME} {ROW.WHATEVER}, you assign an array to the variable ROW once
- Global PHP variables available without making assigns for eg. {PHP.HTTP_HOST} {PHP.PHP_SELF} or any variable: {PHP.session_id}
- Assign using arrays for eg. $xtpl->assign(array(STUFF=>"kewlstuff",ROW=>$row));
- Default nullstring for unassigned variables and unparsed blocks, custom nullstring for every variable or block
- Dynamic blocks:
- Multiple level dynamic blocks (nested blocks)
- Autoreset feature (do not reset subblocks when reparsing parent block)
- recursive parse to parse all subblocks of a block
- File(template) include: {FILE "another.template.xtpl"}, the included templates can also contain includes recursively.. uses fopen so you can include http:// and ftp:// files too
- Very simple and powerful syntax, you'll love it :)

The code is very short and very optimized, according to my speed tests it's the fastest template engine around which can do nested blocks and variables..

The basic syntax is from FastTemplate and QuickTemplate (http://phpclasses.upperdesign.com/browse.html/package/49), but the entire class was written by me from scratch in one day, without a line from other
template engines. THIS IS NOT A REWRITE OF OTHER ENGINES!

The algorithm used makes this code amazing fast, you can do a bunch of nested dynamic blocks and everything you want, because it doesn't use recursive calls to build up the block tree.

Contains 7 examples (which covers all features i think), I tried to write them so even newbies should understand easily.

Docs and some functions i didn't need (clearing variables, etc) are still missing, but they'll come.

Current version is 0.2.4.

Licensed by LGPL.

WARNING: these files are outdated, the latest versions available from the project homepage: http://xtpl.sourceforge.net/

  Groups   Rate classes User ratings   Applications   Related links   Files Files  

  Groups  
Group folder image Templates Template processing engines and components View top rated classes


  User ratings  
Ratings
Utility
Consistency
Documentation
Examples
Tests
Videos
Overall
Rank
All time:
Good (81.8%)
Good (81.8%)
-
-
-
-
Not sure (49.1%)
1575
Month:
Not yet rated by the users

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.

  Related links  
Link Description
Official Home of XTemplate Official Site for XTemplate - Be sure to check it out it contains brand new version of this class!
http://freshmeat.net/appindex/2000/06/13/960897300.html freshmeat entry for the class
XTemplate home XTemplate home @ sourceforge

  Files folder image Files  
File Role Description
Plain text file description.txt ??? contains the description of the class
Plain text file ex1.p ??? example 1 (demonstrates basic features)
Plain text file ex1.xtpl ??? template file for ex1.p
Plain text file ex2.p ??? example 2 (demonstrates nested blocks)
Plain text file ex2.xtpl ??? template file for ex2.p
Plain text file ex3.p ??? example 3 (demonstrates autoreset)
Plain text file ex3.xtpl ??? template file for ex3.p
Plain text file ex4.p ??? example 4 (demonstrates recursive parse)
Plain text file ex4.xtpl ??? template file for ex4.p
Plain text file ex5.p ??? example 5 (demonstrates SetNullString)
Plain text file ex5.xtpl ??? template file for ex5.p
Plain text file ex6.p ??? example 6 (demonstrates SetNullBlock)
Plain text file ex6.xtpl ??? template file for ex6.p
Plain text file ex7-inc.xtpl ??? needed by ex7.p
Plain text file ex7-inc2.xtpl ??? needed by ex7.p
Plain text file ex7.p ??? example 7 (demonstrates includes)
Plain text file ex7.xtpl ??? template file for ex7.p
Plain text file license.txt ??? GNU Lesser General Public License
Plain text file xtpl.p ??? XTemplate class file

Download all files: xtemplate.tar.gz xtemplate.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.