super-light templating system in PHP that doesn't allow php code inside templates or use eval

Twig might be for you.

It can do conditions, and has a sandbox mode for untrusted code.

It does compilation and caching, but that seems to be possible to turn off.


There's also a Mustache port for PHP. The PHP port is here. The syntax is similar to what you're already doing, and supports simple IF and FOREACH-type loops.

And, does it without eval.


Have a look at Twig or H2O.

  • http://www.twig-project.org/
  • http://www.h2o-template.org/