W3cubDocs

/Symfony 3.0

Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper

class TranslatorHelper extends Helper

TranslatorHelper.

Methods

setCharset(string $charset)

Sets the default charset.

from Helper
string getCharset()

Gets the default charset.

from Helper
__construct(TranslatorInterface $translator)

Constructor.

trans($id, array $parameters = array(), $domain = 'messages', $locale = null)
transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null)
string getName()

Returns the canonical name of this helper.

Details

public setCharset(string $charset)

Sets the default charset.

Parameters

string $charset The charset

public string getCharset()

Gets the default charset.

Return Value

string The default charset

public __construct(TranslatorInterface $translator)

Constructor.

Parameters

TranslatorInterface $translator A TranslatorInterface instance

public trans($id, array $parameters = array(), $domain = 'messages', $locale = null)

Parameters

$id
array $parameters
$domain
$locale

See also

TranslatorInterface::trans()

public transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null)

Parameters

$id
$number
array $parameters
$domain
$locale

See also

TranslatorInterface::transChoice()

public string getName()

Returns the canonical name of this helper.

Return Value

string The canonical name

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Bundle/FrameworkBundle/Templating/Helper/TranslatorHelper.html