Render a Form as a table just by modifying the decorators

package Gems
subpackage Form
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.4
inherited_from \Gems_Form

 Methods

Constructor

__construct(mixed $options = null) : void
Inherited

Registers form view helper as decorator

Parameters

$options

mixed

activateBootstrap()

activateBootstrap() 
Inherited

Activate JQuery for this form

activateJQuery() : \MUtil_Form
Inherited

Returns

\MUtil_Form(continuation pattern)

Add a display group to the subform

addDisplayGroup(array $elements, string $name, array $options = null) : \Gems_Form_TabSubForm

This allows to render multiple fields in one table cell. Provide a description to set the label for the group. When the special option showLabels is set to true, inside the tabel cell all fields will still show their own label.

Example: $this->addDisplayGroup(array('firstname', 'infix', 'lastname'), 'name_group', array('description'=>'Name', 'showLabels'=>true); This would result in a two cell table row, with first cell the description of the group 'Name' and in the second cell the three input boxes, with their label in front. If you leave the showLabels out, you will get just three inputboxes for the name parts.

Parameters

$elements

array

Array with names of the fields you want to add

$name

string

The (unique) name for this new group

$options

array

An array of key=>value options to set for the group

Returns

\Gems_Form_TabSubForm

Add a new element

addElement(string|\Zend_Form_Element $element, string $name = null, array|\Zend_Config $options = null) : \Zend_Form
Inherited

$element may be either a string element type, or an object of type \Zend_Form_Element. If a string element type is provided, $name must be provided, and $options may be optionally provided for configuring the element.

If a \Zend_Form_Element is provided, $name may be optionally provided, and any provided $options will be ignored.

Parameters

$element

string\Zend_Form_Element

$name

string

$options

array\Zend_Config

Exceptions

\Zend_Form_Exception on invalid element

Returns

\Zend_Form(continuation pattern)

doRow()

doRow($content, $label, $class, $element) 
Static

Parameters

$content

$label

$class

$element

doRowDisplayGroup()

doRowDisplayGroup($content, $element, array $options) 
Static

Parameters

$content

$element

$options

doRowElement()

doRowElement(string $content, \Zend_Form_Element $element, array $options) : string
Static

Parameters

$content

string

$element

\Zend_Form_Element

$options

array

Returns

string

Fix the decorators so we get the table layout we want. Normally this is called only once when rendering the form.

fixDecorators() 

Get the autosubmit arguments (if any)

getAutoSubmit() : array
Inherited

Returns

arrayor null

Is this a form that autosubmits?

isAutoSubmit() : boolean
Inherited

Returns

boolean

Load default decorators

loadDefaultDecorators() : void

Fix the decorators the first time we try to render the form

render(\Zend_View_Interface $view = null) : string

Parameters

$view

\Zend_View_Interface

Returns

string

Change the form into an autosubmit form

setAutoSubmit(mixed $submitUrl, mixed $targetId, $selective = false
Inherited

Parameters

$submitUrl

mixed

Url as \MUtil_Html_UrlArrayAttribute, array or string

$targetId

mixed

Id of html element whose content is replaced by the submit result: \MUtil_Html_ElementInterface or string

$selective

_activateJQueryView()

_activateJQueryView(\Zend_View_Interface $view = null
Inherited

Parameters

$view

_fixDecoratorDisplayGroup()

_fixDecoratorDisplayGroup($element) 

Parameters

$element

_fixDecoratorElement()

_fixDecoratorElement($element) 

Parameters

$element

_fixDecoratorHiddenSubmit()

_fixDecoratorHiddenSubmit($element) 

Parameters

$element

_fixDecoratorHtml()

_fixDecoratorHtml($element) 

Parameters

$element

Change all elements into an autosubmit element

_enableAutoSubmitElement(mixed $element) 
Inherited

Call only when $_autoSubmit is set

Parameters

$element

mixed

Get a ViewHelper or ZendX decorator to add in front of the decorator chain

_getImportantDecorator(\Zend_Form_Element $element) : null | \Zend_Form_Decorator_Abstract

Parameters

$element

\Zend_Form_Element

Returns

null\Zend_Form_Decorator_Abstract

 Properties

 

If set this holds the url and targetid for the autosubmit

$_autosubmit : array

Default

null
 

Whether or not form elements are members of an array

$_isArray : boolean

Default

false
 

$_alternate

$_alternate 

Default

null