PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Volker Dusch's Blog: Mandatory "Template Engines (Twig) vs Plain Old PHP" Post

Note: This article was originally published at PHPDeveloper on 23 March 2011.
PHPDeveloper

Volker Dusch has posted what he calls his mandatory templating post comparing the benefits of using plain PHP for templates versus the Twig.

If you read some of my previous posts you know me as a "clean code" guy. I like readable, understandable and maintainable code. The same goes for templates. I need to be able to parse very quickly what is happening.. at least i want to.

He argues that, because the syntax of something like Twig is so much simpler and more readable, it's a better solution in the long run (technical considerations not withstanding). As an example he provides a side by side comparison visual image of the a template for each.