a SensioLabs Product

The flexible, fast, and secure
template engine for PHP

Table of Contents

Questions & Feedback


Twig documentation is licensed under the new BSD license.

Twig Extensions

The Twig Extensions is a library that provides several useful extensions for Twig. You can find it's code at GitHub.com/twigphp/Twig-extensions.


This library can be installed via Composer running the following from the command line:

composer require twig/extensions
  • Text: Provides useful filters for text manipulation;
  • I18n: Adds internationalization support via the gettext library;
  • Intl: Adds a filter for localization of DateTime objects, numbers and currency;
  • Array: Provides useful filters for array manipulation;
  • Date: Adds a filter for rendering the difference between dates.
This website is powered by PHP and Twig. The Twig logo is © 2010-2016 SensioLabs