a Sensio Labs Product

The flexible, fast, and secure
template engine for PHP

Table of Contents

Questions & Feedback


Twig documentation is licensed under the new BSD license.

The Text Extension

The Text extension provides the following filters:

  • truncate
  • wordwrap


First, install the Extensions library. Next, add the extension to Twig:

$twig->addExtension(new Twig_Extensions_Extension_Text());
This website is powered by PHP and Twig. The Twig logo is © 2010-2012 Sensio Labs