Next Level Twig: Extensions
kerasai
Drupal 8 features many enhancements, one of the most-prominent being the implementation of the Twig templating system. But are you really getting the most out of your Twig? If you’re not using Twig extensions, then no--you’re not.
Twig extensions allow developers to add processing capabilities to Twig’s template rendering via via custom filters and functions. The Twig Tweak module is a popular solution for adding common functionality to Twig, and as developers we can provide even more power to the folks working with our templates.
This is a quick session that will cover:
- Functionality provided by the core and contrib extensions
- Implementing custom Twig extensions
- Practical examples of functionally possibly through Twig extensions
- Pros and cons of other template wrangling methods
Resources:
- Twig extension 1.x documentation: https://twig.symfony.com/doc/1.x/advanced.html
- Drupal Core Twig Filters: https://www.drupal.org/node/2357633
- Drupal Core Twig Functions: https://www.drupal.org/node/2486991
- Twig Tweak Module: https://www.drupal.org/project/twig_tweak
- Twig Extensions Module: https://www.drupal.org/project/twig_extensions
Session Track
PHP
Experience Level
Intermediate
Drupal Version
When & Where
Time:
Wednesday, 11 April, 2018 - 14:15 to 14:40
Room:
101C | Tag1 Consulting