XTemplate: new template engine available!
| From: | debreceni barnab�s cranx | Date: | Fri, 09 Jun 2000 16:24:41 +0000 |
| Subject: | XTemplate: new template engine available! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-1402@lists.php.net to get a copy of this message | ||
i've made myself a new template engine which suits my needs and decided to
release it to the public..
don't know which engine to use? FastTemplate, QuickTemplate, PHPLIB, etc..
all of them have pros cons..
i tried to put every good feature and ideas from them in my own class, it's
very easy to use, and very _FAST_.
see it for yourself.
http://phpclasses.upperdesign.com/browse.html/package/62
description: --->>
template engine for php, allows to store your html code apart from your php
code.
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
-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.3, tested it more & more.
licensed LGPL.