Minimalistic PHP template engine with caching but not Smarty?
Posted
by Pekka
on Stack Overflow
See other posts from Stack Overflow
or by Pekka
Published on 2010-04-03T09:34:59Z
Indexed on
2010/04/03
9:43 UTC
Read the original article
Hit count: 332
There are loads of questions for "the right" PHP template engine, but none of them is focused on caching.
Does anybody know a lightweight, high-quality, PHP 5 based template engine that does the following out of the box:
Low-level templating functions (Replacements, loops, and filtering, maybe conditionals)
Caching of the parsed results with the possibility to set an individual TTL per item, and of course to force a reload programmatically
Extremely easy usage (like Smarty's)
Modest in polluting the namespace (the ideal solution would be one class to interact with from the outside application)
But not Smarty. I have nothing against, and often use, Smarty, but I am looking for something a bit simpler and leaner.
I took a look at Fabien Potencier's Twig that looks very nice and compiles templates into PHP code, but it doesn't do any actual caching beyond that.
I need and want a template engine, as I need to completely separate code and presentation in a way that a HTML designer can understand later on, so please no fundamental discussions about whether template engines in PHP make sense. Those discussions are important, but they already exist on SO.
© Stack Overflow or respective owner