Twig icon indicating copy to clipboard operation
Twig copied to clipboard

Access to another domain in a template file

Open gregorybellencontre opened this issue 12 years ago • 1 comments

I installed Twig outside of Symfony for a project and I was wondering if domains functionnalities were available.

Translations works fine actually, but I can't access to another domain from the templates. For example, I need to make : {% trans from "other_domain" %}My string to translate{% endtrans %}

And it's not working, like the following statement : {% trans_default_domain "other_domain" %}

These functions are defined in Symfony in a complement of Twig, but I would need to use them outside of Symfony, and the Twig package doesn't get them inside. So I'm searching for a possible extension that may exists ...

Ideas ?

gregorybellencontre avatar Feb 10 '14 13:02 gregorybellencontre

Use the TranslationExtension available in the Symfony Twig Bridge, and you will get the functionalities available in Symfony: https://packagist.org/packages/symfony/twig-bridge

stof avatar Mar 03 '14 22:03 stof