Interface TranslatorAwareTrait

Summary

Fully Qualified Name: Zend\View\Helper\TranslatorAwareTrait

Description

Trait for implementing Zend\I18n\Translator\TranslatorAwareInterface.

This can be used by helpers that need to implement the interface, whether via explicit implementation or duck typing.

Methods

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

Method Details

getTranslator()

Returns translator used in helper

Returns: \Translator|null

getTranslatorTextDomain()

Return the translation text domain

Returns: string

hasTranslator()

Checks if the helper has a translator

Returns: bool

isTranslatorEnabled()

Returns whether translator is enabled and should be used

Returns: bool

setTranslator()

Sets translator to use in helper

Parameter Name Type Description
$translator \Translator [optional]
$textDomain string [optional]

Returns: \HeadTitle

setTranslatorEnabled()

Sets whether translator is enabled and should be used

Parameter Name Type Description
$enabled bool [optional]

Returns: \HeadTitle

setTranslatorTextDomain()

Set translation text domain

Parameter Name Type Description
$textDomain string

Returns: \HeadTitle

Top