2015-05-10, 08:27 AM
Hi,
Yes Twig has been firmly settled on. Other options were evaluated (including the Blade engine provided with Laravel), but we chose Twig for the following reasons:
Yes Twig has been firmly settled on. Other options were evaluated (including the Blade engine provided with Laravel), but we chose Twig for the following reasons:
- Security - Twig will only allow pre-defined functions and helpers. Tools like Blade allow the execution of PHP functions, using a headache for themes on the mods site.
- Speed - Twig caches compiled templates, meaning there is very little performance hit.
- Readability - Twig is widely used in many other projects and is very easy to read and understand.
- Flexibility - Twig is very flexible, and additional helper functions and filters can easily be defined. For instance, we have a function called "render_profile_link", which will (as the name implies) render a fully formatted link to a user's profile.