Twig in Drupal
Twig is a templating engine for PHP and is part of the Symfony2 framework.
In Drupal 8, Twig replaces PHPTemplate as the default templating engine. As a result of this change, all theme_* functions and *.tpl.php files based on PHPTemplate have been replaced by *.html.twig template files.
Note that Drupal 8 currently uses Twig version 1.x. However, Drupal 8.7 and later are compatible with Twig 2.x. Some Twig features differ between these versions, so theme developers should avoid deprecated Twig features to ensure future compatibility.
Drupal’s online documentation is © 2000-2020 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.