TranslationExtension
class TranslationExtension extends Twig_Extension
Provides integration of the Translation component with Twig.
Methods
| __construct(TranslatorInterface $translator, Twig_NodeVisitorInterface $translationNodeVisitor = null) | ||
| getTranslator() | ||
| getFilters() {@inheritdoc} | ||
| array | getTokenParsers() Returns the token parser instance to add to the existing list. | |
| getNodeVisitors() {@inheritdoc} | ||
| getTranslationNodeVisitor() | ||
| trans($message, array $arguments = array(), $domain = null, $locale = null) | ||
| transchoice($message, $count, array $arguments = array(), $domain = null, $locale = null) | ||
| getName() {@inheritdoc} |
Details
__construct(TranslatorInterface $translator, Twig_NodeVisitorInterface $translationNodeVisitor = null)
Parameters
| TranslatorInterface | $translator | |
| Twig_NodeVisitorInterface | $translationNodeVisitor |
getTranslator()
getFilters()
{@inheritdoc}
array getTokenParsers()
Returns the token parser instance to add to the existing list.
Return Value
| array | An array of Twig_TokenParser instances |
getNodeVisitors()
{@inheritdoc}
getTranslationNodeVisitor()
trans($message, array $arguments = array(), $domain = null, $locale = null)
Parameters
| $message | ||
| array | $arguments | |
| $domain | ||
| $locale |
transchoice($message, $count, array $arguments = array(), $domain = null, $locale = null)
Parameters
| $message | ||
| $count | ||
| array | $arguments | |
| $domain | ||
| $locale |
getName()
{@inheritdoc}
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Bridge/Twig/Extension/TranslationExtension.html