[ Index ]
 

Code source de SugarCRM 5.0.0beta1

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/XTemplate/ -> README (source)

   1  template engine for php, allows to store your html code apart from your php code.
   2  (tested with php 3.0.11, 4.0.3, 4.0.4)
   3  
   4  features:
   5      -simple variable interpolation ( {STUFF} )
   6      -array variable interpolation        
   7       for eg. {ROW.ID} {ROW.NAME} {ROW.WHATEVER}, you assign an array to the variable ROW once 
   8      -global PHP variables available without making assigns
   9       for eg. {PHP.HTTP_HOST} {PHP.PHP_SELF} or any variable: {PHP.session_id}
  10      -assign using arrays 
  11      for eg. $xtpl->assign(array(STUFF=>"kewlstuff",ROW=>$row));
  12      -default nullstring for unassigned variables and unparsed blocks,
  13       custom nullstring for every variable or block
  14      -dynamic blocks:
  15          -multiple level dynamic blocks (nested blocks)
  16          -autoreset feature (do not reset subblocks when reparsing parent block)
  17          -recursive parse to parse all subblocks of a block
  18      -file(template) include: {FILE "another.template.xtpl"}, the included templates can
  19       also contain includes recursively.. uses fopen so you can include http:// and ftp:// files too
  20      -very simple and powerful syntax, you'll love it :)
  21  
  22  the code is very short and very optimized, according to my speed tests it's the 
  23  fastest template engine around which can do nested blocks and variables..
  24  
  25  the basic syntax is from FastTemplate and QuickTemplate (http://phpclasses.upperdesign.com/browse.html/package/49),
  26  but the entire class was written by me from scratch in one day, without a line from other
  27  template engines. THIS IS NOT A REWRITE OF OTHER ENGINES!
  28  the algorithm used makes this code amazing fast, you can do a bunch of
  29  nested dynamic blocks and everything you want, because it doesn't use recursive calls
  30  to build up the block tree.
  31  
  32  contains 7 examples (which covers all features i think), 
  33  i tried to write them so even newbies should understand easily.
  34  
  35  docs and some functions i didn't need (clearing variables, etc) are still missing, but they'll come.
  36  
  37  current version is 0.2.4, tested it more & more.
  38  
  39  contact info contained in xtpl.p
  40  
  41  licensed LGPL.


Généré le : Tue Sep 11 10:48:47 2007 par Balluche grâce à PHPXref 0.7