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
ファイルを表示 Open project: kimai/kimai Class Usage Examples

Protected Properties

Property Type Description
$_buttonTypes array Element types that represent buttons
$_helper string View helper to use when rendering

Public Methods

Method 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 method

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

getHelper() public method

Retrieve view helper for rendering element
public getHelper ( ) : string
return string

getName() public method

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

getValue() public method

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

render() public method

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
return string

setHelper() public method

Set view helper to use when rendering
public setHelper ( string $helper ) : Zend_Form_Decorator_Element_ViewHelper
$helper string
return Zend_Form_Decorator_Element_ViewHelper

Property Details

$_buttonTypes protected_oe property

Element types that represent buttons
protected array $_buttonTypes
return array

$_helper protected_oe property

View helper to use when rendering
protected string $_helper
return string