XTemplate 1.0

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

Features of XTemplate:
- 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.

License type: Freeware
Date added: 8 years, 6 months 19 days ago | Last updated: 8 years, 6 months 19 days ago

More popular Template

This is actually one of the most advanced image hosting script. The imagetize key features: SEO, Ads Ready, Admin

Listing Files

xtemplate
  • ex1.xtpl
  • 1.1 KB
  • 10/02/2005 16:55:40
  • ex4.p
  • 173 Bytes
  • 10/02/2005 16:55:40
  • ex7.p
  • 245 Bytes
  • 10/02/2005 16:55:40
  • ex3.p
  • 1.5 KB
  • 10/02/2005 16:55:40
  • ex7-inc.xtpl
  • 41 Bytes
  • 10/02/2005 16:55:40
  • ex5.xtpl
  • 624 Bytes
  • 10/02/2005 16:55:40
  • ex7.xtpl
  • 560 Bytes
  • 10/02/2005 16:55:40
  • ex7-inc2.xtpl
  • 170 Bytes
  • 10/02/2005 16:55:40
  • ex6.p
  • 879 Bytes
  • 10/02/2005 16:55:40
  • ex4.xtpl
  • 929 Bytes
  • 10/02/2005 16:55:40
  • ex2.p
  • 1.2 KB
  • 10/02/2005 16:55:40
  • ex2.xtpl
  • 463 Bytes
  • 10/02/2005 16:55:40
  • ex1.p
  • 837 Bytes
  • 10/02/2005 16:55:40
  • ex6.xtpl
  • 663 Bytes
  • 10/02/2005 16:55:40
  • ex3.xtpl
  • 466 Bytes
  • 10/02/2005 16:55:40
  • xtpl.p
  • 10.4 KB
  • 10/02/2005 16:55:40
  • ex5.p
  • 991 Bytes
  • 10/02/2005 16:55:40
Hot Scripts
Sponsors