Zend_Dojo_Form_Decorator_DijitElement

Render a dojo dijit element via a view helper

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.

package Zend_Dojo
subpackage Form_Decorator
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
version $Id$
inherited_from \Zend_Form_Decorator_ViewHelper

 Methods

Constructor

__construct(array|\Zend_Config $options = null) : void
Inherited

Accept options during initialization.

inherited_from \Zend_Form_Decorator_Interface::__construct()

Parameters

$options

array\Zend_Config

Clear all options

clearOptions() : \Zend_Form_Decorator_Abstract
Inherited
inherited_from \Zend_Form_Decorator_Interface::clearOptions()

Returns

\Zend_Form_Decorator_Abstract

Retrieve a single dijit option parameter

getDijitParam(string $key) : mixed | null

Parameters

$key

string

Returns

mixednull

Get dijit option parameters

getDijitParams() : array

Returns

array

Retrieve current element

getElement() : \Zend_Form_Element | \Zend_Form
Inherited
inherited_from \Zend_Form_Decorator_Interface::getElement()

Returns

\Zend_Form_Element\Zend_Form

Get element attributes

getElementAttribs() : array

Set id to element name and/or array item.

inherited_from \Zend_Form_Decorator_ViewHelper::getElementAttribs()

Returns

array

Retrieve element attributes

getElementAttribs() : array
Inherited

Set id to element name and/or array item.

Returns

array

Retrieve view helper for rendering element

getHelper() : string
Inherited

Returns

string

Get name

getName() : string
Inherited

If element is a Zend_Form_Element, will attempt to namespace it if the element belongs to an array.

Returns

string

Get option

getOption(string $key) : mixed
Inherited
inherited_from \Zend_Form_Decorator_Interface::getOption()

Parameters

$key

string

Returns

mixed

Retrieve options

getOptions() : array
Inherited
inherited_from \Zend_Form_Decorator_Interface::getOptions()

Returns

array

Determine if decorator should append or prepend content

getPlacement() : string
Inherited

Returns

string

Retrieve separator to use between old and new content

getSeparator() : string
Inherited

Returns

string

Get value

getValue(\Zend_Form_Element $element) : string | null
Inherited

If element type is one of the button types, returns the label.

Parameters

$element

\Zend_Form_Element

Returns

stringnull

Remove single option

removeOption(mixed $key) : void
Inherited
inherited_from \Zend_Form_Decorator_Interface::removeOption()

Parameters

$key

mixed

Render an element using a view helper

render(string $content) : string

Determine view helper from 'helper' option, or, if none set, from the element type. Then call as helper($element->getName(), $element->getValue(), $element->getAttribs())

inherited_from \Zend_Form_Decorator_ViewHelper::render()

Parameters

$content

string

Exceptions

\Zend_Form_Decorator_Exception if element or view are not registered

Returns

string

Decorate content and/or element

render(string $content) : string
Inherited
inherited_from \Zend_Form_Decorator_Interface::render()

Parameters

$content

string

Exceptions

\Zend_Form_Decorator_Exception when unimplemented

Returns

string

Set options from config object

setConfig(\Zend_Config $config) : \Zend_Form_Decorator_Abstract
Inherited
inherited_from \Zend_Form_Decorator_Interface::setConfig()

Parameters

$config

\Zend_Config

Returns

\Zend_Form_Decorator_Abstract

Set a single dijit option parameter

setDijitParam(string $key, mixed $value) : \Zend_Dojo_Form_Decorator_DijitContainer

Parameters

$key

string

$value

mixed

Returns

\Zend_Dojo_Form_Decorator_DijitContainer

Set dijit option parameters

setDijitParams(array $params) : \Zend_Dojo_Form_Decorator_DijitContainer

Parameters

$params

array

Returns

\Zend_Dojo_Form_Decorator_DijitContainer

Set current form element

setElement(\Zend_Form_Element|\Zend_Form $element) : \Zend_Form_Decorator_Abstract
Inherited

While the name is "setElement", a form decorator could decorate either an element or a form object.

inherited_from \Zend_Form_Decorator_Interface::setElement()

Parameters

$element

\Zend_Form_Element\Zend_Form

Exceptions

\Zend_Form_Decorator_Exception on invalid element type

Returns

\Zend_Form_Decorator_Abstract

Set view helper to use when rendering

setHelper(string $helper) : \Zend_Form_Decorator_Element_ViewHelper
Inherited

Parameters

$helper

string

Returns

\Zend_Form_Decorator_Element_ViewHelper

Set option

setOption(string $key, mixed $value) : \Zend_Form_Decorator_Abstract
Inherited
inherited_from \Zend_Form_Decorator_Interface::setOption()

Parameters

$key

string

$value

mixed

Returns

\Zend_Form_Decorator_Abstract

Set options

setOptions(array $options) : \Zend_Form_Decorator_Abstract
Inherited
inherited_from \Zend_Form_Decorator_Interface::setOptions()

Parameters

$options

array

Returns

\Zend_Form_Decorator_Abstract

 Properties

 

Element attributes

$_attribs : array

Default

 

Element types that represent buttons

$_buttonTypes : array

Default

array('Zend_Dojo_Form_Element_Button', 'Zend_Form_Element_Button', 'Zend_Form_Element_Reset', 'Zend_Form_Element_Submit')
inherited_from \Zend_Form_Decorator_ViewHelper::_buttonTypes
 

Element types that represent buttons

$_buttonTypes : array

Default

array('Zend_Form_Element_Button', 'Zend_Form_Element_Reset', 'Zend_Form_Element_Submit')
 

Dijit option parameters

$_dijitParams : array

Default

array()
 

$_element

$_element : \Zend_Form_Element | \Zend_Form

Default

 

View helper to use when rendering

$_helper : string

Default

 

Decorator options

$_options : array

Default

array()
 

Default placement: append

$_placement : string

Default

'APPEND'
 

Separator between new content and old

$_separator : string

Default

PHP_EOL

 Constants

 

Placement constants

APPEND = 'APPEND' 
 

PREPEND

PREPEND = 'PREPEND'