Enable Twig Extentions in Symfony2

Twig extentions is included by default in the vendors but to enable one of them like the Text (to be able to use nl2br) add the following to your app/config/config.yml

services: 
    twig.extension.txt: 
        class: Twig_Extensions_Extension_Text 
        tags: 
            - { name: twig.extension }

One Response to “Enable Twig Extentions in Symfony2”

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>