W3cubDocs

/Symfony 4.1

TranslatorHelper

class TranslatorHelper extends Helper

Properties

protected $charset from Helper
protected $translator

Methods

setCharset(string $charset)

Sets the default charset.

from Helper
string getCharset()

Gets the default charset.

from Helper
__construct(TranslatorInterface $translator)
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

setCharset(string $charset)

Sets the default charset.

Parameters

string $charset The charset

string getCharset()

Gets the default charset.

Return Value

string The default charset

__construct(TranslatorInterface $translator)

Parameters

TranslatorInterface $translator

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

Parameters

$id
array $parameters
$domain
$locale

See also

TranslatorInterface::trans

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

Parameters

$id
$number
array $parameters
$domain
$locale

See also

TranslatorInterface::transChoice

string getName()

Returns the canonical name of this helper.

Return Value

string The canonical name