ET (Easy Template) is the simplest AND the most powerful template engine for php. May be the best one ;-)
- Main features:
- The fastest template engine. At least 10 times faster.
- Isolate presentation code from processing and NOT only php from html.
- Display clean templates in html editors.
- Process templates variables, nested blocks, conditional structures ... and much more !
- Sub-templates inclusions.
- Allow php code in templates (just allowed, not adviced ! ;-).
- Cache with ability to set differents expiration times in the same page.
- User-defined tags, in a configuration file and/or when running.
- Error handler.
- ...
- Limitation:
- Specifically written for php: actually, you cannot use the same templates for other languages.
- History:
Templates are a wonderful way to separate processing logic from design logic. However, templates engines are sometimes buggy, sometimes heavy,
and often slow. I was searching the web for "the ultimate template engine" when I read a very interesting point of view, written in 2003 by Brian Lozier. He points out that powerful templates engines are almost as complex as php itself, and always slower. His
text was illustrated by a short sample code with "php-based templates".
But
the goal wasn't achieved: this very simple code gave caching and powerful templating, but didn't offer a way to simply visualize templates in a
browser, because templates variables were in fact php inclusions... ;-(
So, I tried to achieve a "perfect" ;-) template engine with:
- Ability to display templates in browser or html editors.
- Caching.
- Templates inclusions.
I've added a "compiler" for templates variables written with a powerful AND browser-friendly syntax ... and the goal was
achieved: the "ultimate" template engine was born ;-)
I work actually to make it smoother and as enough robust as I could to release it under GPL license, and to include it in a CMS.