Fully Qualified Name: | Laminas\View\Helper\TranslatorAwareTrait |
Trait for implementing Laminas\I18n\Translator\TranslatorAwareInterface.
This can be used by helpers that need to implement the interface, whether via explicit implementation or duck typing.
Name | Description | Defined By |
---|---|---|
getTranslator() | Returns translator used in helper | TranslatorAwareTrait |
getTranslatorTextDomain() | Return the translation text domain | TranslatorAwareTrait |
hasTranslator() | Checks if the helper has a translator | TranslatorAwareTrait |
isTranslatorEnabled() | Returns whether translator is enabled and should be used | TranslatorAwareTrait |
setTranslator() | Sets translator to use in helper | TranslatorAwareTrait |
setTranslatorEnabled() | Sets whether translator is enabled and should be used | TranslatorAwareTrait |
setTranslatorTextDomain() | Set translation text domain | TranslatorAwareTrait |
Returns translator used in helper
Returns: \Translator|null
Return the translation text domain
Returns: string
Checks if the helper has a translator
Returns: bool
Returns whether translator is enabled and should be used
Returns: bool
Sets translator to use in helper
Parameter Name | Type | Description |
---|---|---|
$translator | \Translator | [optional] |
$textDomain | string | [optional] |
Returns: \HeadTitle
Sets whether translator is enabled and should be used
Parameter Name | Type | Description |
---|---|---|
$enabled | bool | [optional] |
Returns: \HeadTitle
Set translation text domain
Parameter Name | Type | Description |
---|---|---|
$textDomain | string |
Returns: \HeadTitle