PHP Class TwbBundle\Form\View\Helper\TwbBundleFormElement

Inheritance: extends Zend\Form\View\Helper\FormElement, implements Zend\I18n\Translator\TranslatorAwareInterface
Show file Open project: neilime/zf2-twb-bundle Class Usage Examples

Protected Properties

Property Type Description
$addonFormat string
$classMap array Instance map to view helper
$inputGroupFormat string
$options TwbBundle\Options\ModuleOptions Hold configurable options
$translator Zend\I18n\Translator\Translator Translator (optional)
$translatorEnabled boolean Whether translator should be used
$translatorTextDomain string Translator text domain (optional)

Public Methods

Method Description
__construct ( ModuleOptions $options )
getTranslator ( ) : null | Zend\I18n\Translator\TranslatorInterface Returns translator used in helper
getTranslatorTextDomain ( ) : string Return the translation text domain
hasTranslator ( ) : boolean Checks if the helper has a translator
isTranslatorEnabled ( ) : boolean Returns whether translator is enabled and should be used
render ( Zend\Form\ElementInterface $oElement ) : string Render an element
setTranslator ( Zend\I18n\Translator\TranslatorInterface $oTranslator = null, string $sTextDomain = null ) : TwbBundleFormElement Sets translator to use in helper
setTranslatorEnabled ( boolean $bEnabled = true ) : TwbBundleFormElement Sets whether translator is enabled and should be used
setTranslatorTextDomain ( string $sTextDomain = 'default' ) : TwbBundleFormElement Set translation text domain

Protected Methods

Method Description
renderAddOn ( string $aAddOnOptions ) : string Render addo-on markup

Method Details

__construct() public method

public __construct ( ModuleOptions $options )
$options TwbBundle\Options\ModuleOptions

getTranslator() public method

Returns translator used in helper
See also: TranslatorAwareInterface::getTranslator()
public getTranslator ( ) : null | Zend\I18n\Translator\TranslatorInterface
return null | Zend\I18n\Translator\TranslatorInterface

getTranslatorTextDomain() public method

Return the translation text domain
See also: TranslatorAwareInterface::getTranslatorTextDomain()
public getTranslatorTextDomain ( ) : string
return string

hasTranslator() public method

Checks if the helper has a translator
See also: TranslatorAwareInterface::hasTranslator()
public hasTranslator ( ) : boolean
return boolean

isTranslatorEnabled() public method

Returns whether translator is enabled and should be used
See also: TranslatorAwareInterface::isTranslatorEnabled()
public isTranslatorEnabled ( ) : boolean
return boolean

render() public method

Render an element
public render ( Zend\Form\ElementInterface $oElement ) : string
$oElement Zend\Form\ElementInterface
return string

renderAddOn() protected method

Render addo-on markup
protected renderAddOn ( string $aAddOnOptions ) : string
$aAddOnOptions string
return string

setTranslator() public method

Sets translator to use in helper
See also: TranslatorAwareInterface::setTranslator()
public setTranslator ( Zend\I18n\Translator\TranslatorInterface $oTranslator = null, string $sTextDomain = null ) : TwbBundleFormElement
$oTranslator Zend\I18n\Translator\TranslatorInterface : [optional] translator. Default is null, which sets no translator.
$sTextDomain string : [optional] text domain Default is null, which skips setTranslatorTextDomain
return TwbBundleFormElement

setTranslatorEnabled() public method

Sets whether translator is enabled and should be used
See also: TranslatorAwareInterface::setTranslatorEnabled()
public setTranslatorEnabled ( boolean $bEnabled = true ) : TwbBundleFormElement
$bEnabled boolean
return TwbBundleFormElement

setTranslatorTextDomain() public method

Set translation text domain
See also: TranslatorAwareInterface::setTranslatorTextDomain()
public setTranslatorTextDomain ( string $sTextDomain = 'default' ) : TwbBundleFormElement
$sTextDomain string
return TwbBundleFormElement

Property Details

$addonFormat protected static property

protected static string $addonFormat
return string

$classMap protected property

Instance map to view helper
protected array $classMap
return array

$inputGroupFormat protected static property

protected static string $inputGroupFormat
return string

$options protected property

Hold configurable options
protected ModuleOptions,TwbBundle\Options $options
return TwbBundle\Options\ModuleOptions

$translator protected property

Translator (optional)
protected Translator,Zend\I18n\Translator $translator
return Zend\I18n\Translator\Translator

$translatorEnabled protected property

Whether translator should be used
protected bool $translatorEnabled
return boolean

$translatorTextDomain protected property

Translator text domain (optional)
protected string $translatorTextDomain
return string