FindSoftware

Twig

Template engine for PHP that compiles templates to optimized PHP code and can run untrusted templates in a sandbox.

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

Status
Active
Maintainer
Twig Team5
Maintained by
Community
First release
20094

Rendering and deploy

Install with
composer3

Releases

Current major version
38
Last release
2026-09-258

Adoption

GitHub stars
8,3802
Packagist downloads
513,258,66310
Contributors
4019
Dependent repositories
131,82911
Dependent packages
5,84711

Why these figures do not compare

Sources

  1. 2026-11-16: links
    twig.symfony.com/
  2. 2026-11-16: links, Written in, GitHub stars
    api.github.com/repos/twigphp/Twig
  3. 2026-11-16: links, Install with
    twig.symfony.com/doc/3.x/intro.html
  4. 2026-11-16: First release
    api.github.com/repos/twigphp/Twig/tags
  5. 2026-11-16: Maintainer
    raw.githubusercontent.com/twigphp/Twig/3.x/LICENSE
  6. 2026-11-16: Categories
    raw.githubusercontent.com/twigphp/Twig/3.x/README.rst
  7. 2026-11-16: Runtime, Minimum runtime, License, License model
    github.com/twigphp/Twig/blob/v3.30.0/composer.json
  8. 2026-11-16: Current major version, Last release
    api.github.com/repos/twigphp/Twig/releases
  9. 2026-11-16: Contributors
    api.github.com/repos/twigphp/Twig/contributors
  10. 2026-11-16: Packagist downloads
    packagist.org/packages/twig/twig.json
  11. 2026-11-16: Dependent packages, Dependent repositories
    packages.ecosyste.ms/api/v1/registries/packagist.org/packages/twig%2Ftwig

Last reviewed · Listed since Edit on GitHubThis page as markdownas JSON