On Tue, 1 Feb 2011 17:31:29 -0800 (PST), Oleg <[email protected]>
wrote:
> Hello,
> 
> I'm trying to use 'truncate' twig filter like this:
> 
>     {{ category|upper|truncate(20) }}
> 
> But instead I get an error "The filter "truncate" does not exist". I
> see that this filter is defined in twig.xml resource of TwigBundle
> bundle:
> 
>         <service id="twig.extension.text"
> class="Twig_Extensions_Extension_Text" public="false" />
> 
> But apparently I also need to somehow turn it on. How can I do that?
> 
> Thanks,
> Oleg

You can enable this extension in the twig configuration:

twig.config:
   extensions: [twig.extension.text]

If you want to enable other twig extensions (debug for example) just add
the service id in this array.

Regards
-- 
Christophe | Stof

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to