# Twig

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


Source: https://findsoftware.frbit.cloud/twig/
Last reviewed: 2026-11-16
Listed since: 2026-11-16

## Record

### Links

- home: https://twig.symfony.com/
- repository: https://github.com/twigphp/Twig
- docs: https://twig.symfony.com/doc/3.x/intro.html

### Identity

- status: active
- maintainer: Twig Team
- maintainerType: community
- parent: unknown
- firstRelease: 2009
- hqCountry: unknown

### Kind

- category: library
- hosting: php
- language: php
- runtime: php
- runtimeMin: php 8.1
- basedOn: unknown

### Content

- contentStore: not applicable
- databases: not applicable
- adminUi: not applicable
- headlessApi: not applicable
- templating: not applicable
- i18n: not applicable

### Rendering and deploy

- runsAs: not applicable
- renderingModes: not applicable
- installMethod: composer

### License

- licenseModel: open-source
- license: BSD-3-Clause

### Releases

- currentMajor: 3
- latestReleaseDate: 2026-09-25

### Adoption

- githubStargazers: 8380
- packagistDownloads: 513258663
- npmWeeklyDownloads: not applicable
- contributors: 401
- pluginCount: unknown
- packagistMonthlyDownloads: unknown
- ecosystemsMonthlyDownloads: unknown
- httpArchiveSites: unknown
- wordpressActiveInstalls: unknown
- dependentRepos: 131829
- dependentPackages: 5847

### Sources

- urls: https://twig.symfony.com/ (read 2026-11-16)
- urls: https://api.github.com/repos/twigphp/Twig (read 2026-11-16)
- urls: https://twig.symfony.com/doc/3.x/intro.html (read 2026-11-16)
- firstRelease: https://api.github.com/repos/twigphp/Twig/tags (read 2026-11-16)
- maintainer: https://raw.githubusercontent.com/twigphp/Twig/3.x/LICENSE (read 2026-11-16)
- category: https://raw.githubusercontent.com/twigphp/Twig/3.x/README.rst (read 2026-11-16)
- language: https://api.github.com/repos/twigphp/Twig (read 2026-11-16)
- runtime: https://github.com/twigphp/Twig/blob/v3.30.0/composer.json (read 2026-11-16)
- runtimeMin: https://github.com/twigphp/Twig/blob/v3.30.0/composer.json (read 2026-11-16)
- installMethod: https://twig.symfony.com/doc/3.x/intro.html (read 2026-11-16)
- license: https://github.com/twigphp/Twig/blob/v3.30.0/composer.json (read 2026-11-16)
- licenseModel: https://github.com/twigphp/Twig/blob/v3.30.0/composer.json (read 2026-11-16)
- currentMajor: https://api.github.com/repos/twigphp/Twig/releases (read 2026-11-16)
- latestReleaseDate: https://api.github.com/repos/twigphp/Twig/releases (read 2026-11-16)
- githubStargazers: https://api.github.com/repos/twigphp/Twig (read 2026-11-16)
- contributors: https://api.github.com/repos/twigphp/Twig/contributors (read 2026-11-16)
- packagistDownloads: https://packagist.org/packages/twig/twig.json (read 2026-11-16)
- dependentPackages: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/twig%2Ftwig (read 2026-11-16)
- dependentRepos: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/twig%2Ftwig (read 2026-11-16)

## Notes

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](https://twig.symfony.com/doc/3.x/intro.html) introduces the basic API.

---

Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Attributes are recorded, never scored; absent means unknown.
Credit, in full: FindSoftware, CC BY 4.0
