phemplate

quick intro

phemplate is simple and fast templating engine for php. it provides a way of substituting variables into text templates and do some dynamic block functionality including loops.

templating engines are meant for separation of presentation and logic. that means you can put all your HTML content outside of PHP scripts. HTML can be changed by designers without a fear of messing up your scripts.

don't be afraid and mail me your questions or bug reports. it will only make this code better.

news

2005.07.17
  • move to sourceforge
  • i moved the project to sourceforge. i hope the site will also be migrated.
    i changed unit tests from PHPUnit to SimpleTest. current status.
 
2004.04.21
  • v1.10.1
  • empty file warning bugfix. thanks kraupu.
 
2004.03.04
  • v1.10
  • this version must be rock solid, because it's beta tested :)
  • two new features:
    • option TPL_STRIP_UTF_HEADER for set_file() will strip first 3 bytes of the file if it contains UTF header \xEF\xBB\xBF.

      usage example:
      set_file('temp', 'filename.html', TPL_STRIP_UTF_HEADER);
      set_file('temp', 'filename.html', TPL_STRIP_UTF_HEADER | TPL_BLOCK);

    • option TPL_OPTLOOP for process() will look for <opt> tags inside loop.

      usage example:
      process('out', 'block', TPL_OPTLOOP);
      process('out', 'block', TPL_OPTLOOP | TPL_NOLOOP);

  • updated unit tests and user guide.
 
2004.03.01
 
2003.10.20
  • v1.9.3
  • parse() bugfix. class was stripping characters after first }: 'a}b' -> 'a}'. now it does not :)
 
2003.08.13
  • v1.9.2
  • 'remove_nonjs' bugfix.
 
2003.06.29
 
2003.06.19
  • v1.9!
  • variables can be tied with template: tie_var() and tie_loop().
  • error handler support. now you can catch error messages from template in your code.
  • custom block syntax, thanks to G. van den Hoven.
  • parse() works faster, thanks to Sergej Kurakin.
  • fixed remove_nonjs bug.
  • fixed set_root() bug.
  • documentation yet to come.
 
2003.06.16
  • new website!
  • documentation will be online after a few days.
 
2003.03.14
  • not a bug, but feature update!
  • process() now accepts parameters as bits.
  • v.1.8.1
 
2003.03.14
  • almost a year without updates 8-O.
    on the other hand, i don't get much mails about phemplate usage.
    i stopped maintaining template benchmark, because it took too much time. also, my measures on production server show, that the biggest show-stopper is sql queries and template processing is performed in no time.
  • i hope we won't need bug update 1.8.1 :)
  • new tag <opt> !
  • v1.8
pukomuko, 2003