Twig is a template engine for the PHP programming language. Its syntax originates from Jinja and Django templates. It's an open source product licensed under a BSD License and maintained by Fabien Potencier. The initial version was created by Armin Ronacher.

By toswebdev, 10 February, 2023

In many programming languages, == and === are used to compare values to determine whether they are equal. The difference between == and === depends on the programming language, but in general, == is used for equality comparison that performs type coercion, while === is used for strict equality comparison that does not perform type coercion.

By toswebdev, 5 October, 2022

Edit services configuration for your Drupal site, for default location, should be:


If the folder is correct, but you don't have a services.yml file, rename to services.yml.

Find twig.config section and change debug parameter to true:


By toswebdev, 14 May, 2022

Twig's Extends allows you to inherit all the code from a parent template without having to duplicate it AND replaces parts of it (the parts in Twig blocks). You can only replace parts that are Twig Blocks. If you try and replace anything else in the parent template, you will get an error.

Twig templates can be extended with the following syntax -