W3cubDocs

/Symfony 2.8

Symfony\Bridge\Twig\Extension\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

public __construct(TranslatorInterface $translator, Twig_NodeVisitorInterface $translationNodeVisitor = null)

Parameters

TranslatorInterface $translator
Twig_NodeVisitorInterface $translationNodeVisitor

public getTranslator()

public getFilters()

{@inheritdoc}

public array getTokenParsers()

Returns the token parser instance to add to the existing list.

Return Value

array An array of Twig_TokenParser instances

public getNodeVisitors()

{@inheritdoc}

public getTranslationNodeVisitor()

public trans($message, array $arguments = array(), $domain = null, $locale = null)

Parameters

$message
array $arguments
$domain
$locale

public transchoice($message, $count, array $arguments = array(), $domain = null, $locale = null)

Parameters

$message
$count
array $arguments
$domain
$locale

public getName()

{@inheritdoc}

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.8/Symfony/Bridge/Twig/Extension/TranslationExtension.html