umpirsky / Twig-Gettext-Extractor

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.
MIT License
113 stars 32 forks source link

Error parsing security functions #22

Closed vrubiella closed 9 years ago

vrubiella commented 9 years ago

Hello,

When a template file has security functions as "is_granted", Twig Processor throws an error:

image

I have included "symfony/twig-bridge": "~2.5.6".

This is a bug?

Regards,

vrubiella commented 9 years ago

Hello again,

I found a workaround adding SecurityExtension directly on bin/twig-gettetxt-extractor:

$twig->addExtension(new Symfony\Bridge\Twig\Extension\SecurityExtension());

I don't know if this is the correct way...

Regards,

umpirsky commented 9 years ago

@vrubiella Yes, it is documented in https://github.com/umpirsky/Twig-Gettext-Extractor#custom-extensions. Thanks.