Constants

DECORATOR

DECORATOR

ELEMENT

ELEMENT

METHOD_DELETE

METHOD_DELETE

METHOD_GET

METHOD_GET

METHOD_POST

METHOD_POST

METHOD_PUT

METHOD_PUT

ENCTYPE_URLENCODED

ENCTYPE_URLENCODED

ENCTYPE_MULTIPART

ENCTYPE_MULTIPART

Methods

__construct()

__construct(mixed|array  $options = array()) 

Create a new form

Parameters

mixed|array $options

basic Zend_Form options

init()

init() 

Initialize form

process()

process() 

Process form after submit

isValid()

isValid(array  $data) : boolean

Validate form

Parameters

array $data

Returns

boolean

getValue()

getValue(string  $name) : mixed

Retrieve value for single element

Parameters

string $name

Returns

mixed

getValues()

getValues(boolean  $suppressArrayNotation = false) : array

Retrieve all form element values

Parameters

boolean $suppressArrayNotation

Returns

array

addElement()

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

Add a new element

Basic elements are:

  • Text
  • Password
  • Textarea
  • SimpleText
  • Select
  • Radio
  • Checkbox
  • Hidden

More classes see in CommonPanel\Form\Element and Zend\Form\Element

Parameters

string|\Zend_Form_Element $element
string $name
array|\Zend_Config $options

Returns

\Zend_Form

getElement()

getElement(string  $name) : null|\Zend_Form_Element

Retrieve a single element

Parameters

string $name

Returns

null|\Zend_Form_Element

addControlButtons()

addControlButtons(array  $params = null) 

Add control buttons: Ok and Cancel

[
    'sendTitle' => string,
    'sendHidden' => bool,
    'cancelTitle' => string,
    'cancelLink' => string,
    'cancelHidden' => bool,
    'withSeparator' => bool,
    'hideLegend' => bool,
    'presubmitHandler' => string,
]

Parameters

array $params

getId()

getId() : string

Get element id

Returns

string

lmsg()

lmsg(string  $key, array  $params = array()) : string

Translate message by key according to current locale

Parameters

string $key
array $params

Returns

string

addSubForm()

addSubForm(\Zend_Form  $form, string  $name, null  $order = null) : \Zend_Form

Add a sub form

Parameters

\Zend_Form $form
string $name
null $order

Returns

\Zend_Form

getSubForm()

getSubForm(string  $name) : null|\Zend_Form

Retrieve a single sub form

Parameters

string $name

Returns

null|\Zend_Form

getSubForms()

getSubForms() : array<mixed,\Zend_Form>

Retrieve all sub forms

Returns

array<mixed,\Zend_Form>