O'Reilly logo

Drupal 8: Enterprise Web Development by Chaz Chumley, Matt Glaman, Richard Jones, Nick Abbott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing Twig

Twig (http://twig.sensiolabs.org) is the new template engine introduced to Drupal 8 and is a companion to Symfony, the new PHP framework that Drupal 8 is built on. Twig provides us with a fast and secure way to separate content from PHP logic in a manner that makes it easier for non-developers to work with templates. To help us get a better feel in order to work with Twig, let's first dive into the steps involved in enabling Twig debugging.

Enabling Twig debug

When Twig debugging is turned on within Drupal, we are able to trace which template is being used, where a template is located, and a list of suggested file names to override a template. This functionality is very advantageous and actually quite simple to set up by following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required