a SensioLabs Product

The flexible, fast, and secure
template engine for PHP

You are reading the documentation for Twig 2.x. Switch to the documentation for Twig 1.x.

Questions & Feedback


Twig documentation is licensed under the new BSD license.


You have multiple ways to install Twig.

Installing the Twig PHP package

Installing from the tarball release

  1. Download the most recent tarball from the download page
  2. Verify the integrity of the tarball http://fabien.potencier.org/article/73/signing-project-releases
  3. Unpack the tarball
  4. Move the files somewhere in your project

Installing the development version

git clone git://github.com/twigphp/Twig.git
Website powered by Symfony and Twig, deployed on
The Twig logo is © 2010-2018 SensioLabs