6 Best PHP template engines
Need a template engine in PHP? Discover this list of 6 simple PHP templating engines to install!
For good maintainability of all medium-sized projects (as soon as you exceed 4 pages in my opinion) it is important to separate the logical views of its pages. On an application of a few pages, a large insert <? Php?> Containing all the necessary logic to the page can be enough, but as soon as one uses a router, it is important to find a good template engine.
To help you in this task, I invite you to (re) discover a list of 6 PHP template engines.
Smarty is part of the “old” I discovered Smarty and this language was my first language templating. Updates are not very frequent, and it has perhaps not all younger features, but it still deserves a look.
Twig is a template engine from Symfony (if I’m not mistaken) very simple to install and use in its project. It looks a bit like Mustache or liquid in its operation.
Portage Ruby templating language of the same name. Attention HAML works with the indentation (like Python for example) and can be confusing at first (and completely addictive once the patterns have in place).
Creating Shopify (and ruby originally) Liquid is a perfect language to let users customize a service style of their pages while restricting their rights. Moreover, language is cross-platform, and the same templates can be used in PHP or Ruby indiscriminately.