What is Twig?
DefinitionTwig is a free and open-source template engine for PHP, maintained by the Symfony project, that lets developers write HTML templates with a concise syntax for variables, loops, conditions and template inheritance.
Twig's syntax was inspired by the Jinja and Django template languages, using double curly braces to print values and tags for logic. Templates are compiled to optimized PHP code, and output is escaped automatically by default, which helps prevent cross-site scripting vulnerabilities.
Twig is the default template engine in the Symfony framework and is used by content management systems including Drupal, Craft CMS and Grav, helping keep presentation code separate from application logic.
Twig resources
Topic: Web development
Cite this definition
- APA
What is Twig? (2026, November 22). Glossary. https://glossary.io/twig/
- MLA
“What Is Twig?” Glossary, Coywolf, 22 Nov. 2026, glossary.io/twig/.
- Chicago
“What Is Twig?” Glossary. Coywolf. November 22, 2026. https://glossary.io/twig/.
- HTML link
<a href="https://glossary.io/twig/">What is Twig?</a>
Published