July 30, 2017
Twig is a template engine for PHP. But isn’t PHP itself a template engine?
Yes and no!
Even though PHP started as a template engine, it didn’t evolve like one, and while we can still use it as one please tell me which version of “Hello world” you prefer:
<?php echo "<p> Hello " . $na...
August 15, 2016
In MVC based architectures, working with template engines is an inevitable part of the development routine. It usually goes like this: we prepare and pass the data to the view. In the view, we print them based on our layout design.Here is a basic example of how it works using Twig.
<?php// Twig initialization...
December 16, 2015
If there is one thing the world needs, it’s definitely another PHP template engine! But wait, this one is different!
Many PHP template engines (Smarty, Blade, Twig…) are little more than abstracted PHP code, making it easier to write loops, if/then/else blocks, and display variables with less verbosity than vanilla...