
Twig
Template engine for PHP that compiles templates to optimized PHP code and can run untrusted templates in a sandbox.
twig.symfony.com/repositorydocs
Twig is a template engine for PHP. A PHP application loads templates through a loader and an environment object, then renders a named template with an array of variables. Twig compiles each template to plain PHP code and keeps the compiled files in a cache directory, so the application runs compiled code rather than the template text.
Twig can also evaluate templates written by users in a sandbox, where the developer decides which tags, filters and object methods the template may use. The documentation introduces the basic API.
Identity
Rendering and deploy
- Install with
- composer3
Releases
Adoption
Sources
- 2026-11-16: links
twig.symfony.com/ - 2026-11-16: links, Written in, GitHub stars
api.github.com/repos/twigphp/Twig - 2026-11-16: links, Install with
twig.symfony.com/doc/3.x/intro.html - 2026-11-16: First release
api.github.com/repos/twigphp/Twig/tags - 2026-11-16: Maintainer
raw.githubusercontent.com/twigphp/Twig/3.x/LICENSE - 2026-11-16: Categories
raw.githubusercontent.com/twigphp/Twig/3.x/README.rst - 2026-11-16: Runtime, Minimum runtime, License, License model
github.com/twigphp/Twig/blob/v3.30.0/composer.json - 2026-11-16: Current major version, Last release
api.github.com/repos/twigphp/Twig/releases - 2026-11-16: Contributors
api.github.com/repos/twigphp/Twig/contributors - 2026-11-16: Packagist downloads
packagist.org/packages/twig/twig.json - 2026-11-16: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/packagist.org/packages/twig%2Ftwig