Minimalistic PHP template engine with caching but not Smarty?

There are many questions for the “correct” mechanism of PHP templates, but none of them are caching oriented.

Does anyone know a lightweight, high-quality, PHP 5-based template engine that does the following out of the box:

  • Low-level template functions (replacements, loops and filtering, possibly conditional)

  • Caching the analyzed results with the ability to set an individual TTL on an element and, of course, forcing a reboot

  • Extremely easy to use (e.g. Smarty)

  • Modesty in polluting the namespace (the ideal solution would be one class for interacting with an external application)

But not smarty . I have nothing against it, and often use Smarty, but I'm looking for something simpler and more compact.

I looked at the Fabien Potencier Twig , which looks very nice and compiles templates into PHP code, but it does not do any actual caching on top of that.

I need and need a template engine, since I need to completely separate the code and presentation in such a way that the HTML developer can understand later, so please do not discuss the fundamental discussions about whether template engines make sense in PHP. These discussions are important, but there are specific questions about this.

+3
source share
1 answer

Cached Template

  • , Twig enine .
  • APC. TTL ( ) . .
  • , APC (). , - APC (A must, PHP . , ). APC, , Cache-Lite. / .
+2

Source: https://habr.com/ru/post/1739679/


All Articles