PHP Class Zend_Form_Decorator_ViewHelper

Decorate an element by using a view helper to render it. Accepts the following options: - separator: string with which to separate passed in content and generated content - placement: whether to append or prepend the generated content to the passed in content - helper: the name of the view helper to use Assumes the view helper accepts three parameters, the name, value, and optional attributes; these will be provided by the element.
Inheritance: extends Zend_Form_Decorator_Abstract
Afficher le fichier Open project: kimai/kimai Class Usage Examples

Protected Properties

Свойство Type Description
$_buttonTypes array Element types that represent buttons
$_helper string View helper to use when rendering

Méthodes publiques

Méthode Description
getElementAttribs ( ) : array Retrieve element attributes
getHelper ( ) : string Retrieve view helper for rendering element
getName ( ) : string Get name
getValue ( Zend_Form_Element $element ) : string | null Get value
render ( string $content ) : string Render an element using a view helper
setHelper ( string $helper ) : Zend_Form_Decorator_Element_ViewHelper Set view helper to use when rendering

Method Details

getElementAttribs() public méthode

Set id to element name and/or array item.
public getElementAttribs ( ) : array
Résultat array

getHelper() public méthode

Retrieve view helper for rendering element
public getHelper ( ) : string
Résultat string

getName() public méthode

If element is a Zend_Form_Element, will attempt to namespace it if the element belongs to an array.
public getName ( ) : string
Résultat string

getValue() public méthode

If element type is one of the button types, returns the label.
public getValue ( Zend_Form_Element $element ) : string | null
$element Zend_Form_Element
Résultat string | null

render() public méthode

Determine view helper from 'viewHelper' option, or, if none set, from the element type. Then call as helper($element->getName(), $element->getValue(), $element->getAttribs())
public render ( string $content ) : string
$content string
Résultat string

setHelper() public méthode

Set view helper to use when rendering
public setHelper ( string $helper ) : Zend_Form_Decorator_Element_ViewHelper
$helper string
Résultat Zend_Form_Decorator_Element_ViewHelper

Property Details

$_buttonTypes protected_oe property

Element types that represent buttons
protected array $_buttonTypes
Résultat array

$_helper protected_oe property

View helper to use when rendering
protected string $_helper
Résultat string