Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes | Static Protected Attributes

Zend_Form Class Reference

Inheritance diagram for Zend_Form:
Zend_Validate_Interface ZendX_JQuery_Form

Public Member Functions

 __construct ($options=null)
 __clone ()
 reset ()
 init ()
 setOptions (array $options)
 setConfig (Zend_Config $config)
 setPluginLoader (Zend_Loader_PluginLoader_Interface $loader, $type=null)
 getPluginLoader ($type=null)
 addPrefixPath ($prefix, $path, $type=null)
 addPrefixPaths (array $spec)
 addElementPrefixPath ($prefix, $path, $type=null)
 addElementPrefixPaths (array $spec)
 addDisplayGroupPrefixPath ($prefix, $path)
 addDisplayGroupPrefixPaths (array $spec)
 setAttrib ($key, $value)
 addAttribs (array $attribs)
 setAttribs (array $attribs)
 getAttrib ($key)
 getAttribs ()
 removeAttrib ($key)
 clearAttribs ()
 setAction ($action)
 getAction ()
 setMethod ($method)
 getMethod ()
 setEnctype ($value)
 getEnctype ()
 filterName ($value, $allowBrackets=false)
 setName ($name)
 getName ()
 getFullyQualifiedName ()
 getId ()
 setLegend ($value)
 getLegend ()
 setDescription ($value)
 getDescription ()
 setOrder ($index)
 getOrder ()
 addElement ($element, $name=null, $options=null)
 createElement ($type, $name, $options=null)
 addElements (array $elements)
 setElements (array $elements)
 getElement ($name)
 getElements ()
 removeElement ($name)
 clearElements ()
 setDefaults (array $defaults)
 setDefault ($name, $value)
 getValue ($name)
 getValues ($suppressArrayNotation=false)
 getUnfilteredValue ($name)
 getUnfilteredValues ()
 setElementFilters (array $filters)
 setElementsBelongTo ($array)
 getElementsBelongTo ()
 setIsArray ($flag)
 isArray ()
 addSubForm (Zend_Form $form, $name, $order=null)
 addSubForms (array $subForms)
 setSubForms (array $subForms)
 getSubForm ($name)
 getSubForms ()
 removeSubForm ($name)
 clearSubForms ()
 setDefaultDisplayGroupClass ($class)
 getDefaultDisplayGroupClass ()
 addDisplayGroup (array $elements, $name, $options=null)
 addDisplayGroups (array $groups)
 setDisplayGroups (array $groups)
 getDisplayGroup ($name)
 getDisplayGroups ()
 removeDisplayGroup ($name)
 clearDisplayGroups ()
 populate (array $values)
 isValid ($data)
 isValidPartial (array $data)
 processAjax (array $data)
 addErrorMessage ($message)
 addErrorMessages (array $messages)
 setErrorMessages (array $messages)
 getErrorMessages ()
 clearErrorMessages ()
 markAsError ()
 addError ($message)
 addErrors (array $messages)
 setErrors (array $messages)
 persistData ()
 isErrors ()
 getErrors ($name=null)
 getMessages ($name=null, $suppressArrayNotation=false)
 setView (Zend_View_Interface $view=null)
 getView ()
 addDecorator ($decorator, $options=null)
 addDecorators (array $decorators)
 setDecorators (array $decorators)
 getDecorator ($name)
 getDecorators ()
 removeDecorator ($name)
 clearDecorators ()
 setElementDecorators (array $decorators, array $elements=null, $include=true)
 setDisplayGroupDecorators (array $decorators)
 setSubFormDecorators (array $decorators)
 render (Zend_View_Interface $view=null)
 __toString ()
 setTranslator ($translator=null)
 getTranslator ()
 setDisableTranslator ($flag)
 translatorIsDisabled ()
 __get ($name)
 __set ($name, $value)
 __isset ($name)
 __unset ($name)
 __call ($method, $args)
 current ()
 key ()
 next ()
 rewind ()
 valid ()
 count ()
 setDisableLoadDefaultDecorators ($flag)
 loadDefaultDecoratorsIsDisabled ()
 loadDefaultDecorators ()

Static Public Member Functions

static setDefaultTranslator ($translator=null)
static getDefaultTranslator ()

Data Fields

const DECORATOR = 'DECORATOR'
const ELEMENT = 'ELEMENT'
const METHOD_DELETE = 'delete'
const METHOD_GET = 'get'
const METHOD_POST = 'post'
const METHOD_PUT = 'put'
const ENCTYPE_URLENCODED = 'application/x-www-form-urlencoded'
const ENCTYPE_MULTIPART = 'multipart/form-data'

Protected Member Functions

 _setElementsBelongTo ($name=null)
 _addDisplayGroupObject (Zend_Form_DisplayGroup $group, $name=null)
 _getArrayName ($value)
 _dissolveArrayValue ($value, $arrayPath)
 _attachToArray ($value, $arrayPath)
 _getDecorator ($name, $options)
 _sort ()
 _loadDecorator (array $decorator, $name)
 _getErrorMessages ()

Protected Attributes

 $_attribs = array()
 $_decorators = array()
 $_defaultDisplayGroupClass = 'Zend_Form_DisplayGroup'
 $_description
 $_disableLoadDefaultDecorators = false
 $_displayGroupPrefixPaths = array()
 $_displayGroups = array()
 $_elementDecorators
 $_elementPrefixPaths = array()
 $_elements = array()
 $_elementsBelongTo
 $_errorMessages = array()
 $_errorsExist = false
 $_errorsForced = false
 $_formOrder
 $_isArray = false
 $_legend
 $_loaders = array()
 $_methods = array('delete', 'get', 'post', 'put')
 $_order = array()
 $_orderUpdated = false
 $_subFormPrefixPaths = array()
 $_subForms = array()
 $_translator
 $_translatorDisabled = false
 $_view

Static Protected Attributes

static $_translatorDefault

Detailed Description

Definition at line 33 of file Form.php.


Constructor & Destructor Documentation

__construct ( options = null )

Constructor

Registers form view helper as decorator

Parameters:
mixed$options
Returns:
void

Reimplemented in ZendX_JQuery_Form.

Definition at line 226 of file Form.php.


Member Function Documentation

__call ( method,
args 
)

Overloading: allow rendering specific decorators

Call renderDecoratorName() to render a specific decorator.

Parameters:
string$method
array$args
Returns:
string
Exceptions:
Zend_Form_Exceptionfor invalid decorator or invalid method call

Definition at line 2851 of file Form.php.

__clone (  )

Clone form object and all children

Returns:
void

Definition at line 245 of file Form.php.

__get ( name )

Overloading: access to elements, form groups, and display groups

Parameters:
string$name
Returns:
Zend_Form_Element|Zend_Form|null

Definition at line 2763 of file Form.php.

__isset ( name )

Overloading: access to elements, form groups, and display groups

Parameters:
string$name
Returns:
boolean

Definition at line 2812 of file Form.php.

__set ( name,
value 
)

Overloading: access to elements, form groups, and display groups

Parameters:
string$name
Zend_Form_Element | Zend_Form$value
Returns:
void
Exceptions:
Zend_Form_Exceptionfor invalid $value

Definition at line 2784 of file Form.php.

__toString (  )

Serialize as string

Proxies to render().

Returns:
string

Definition at line 2638 of file Form.php.

__unset ( name )

Overloading: access to elements, form groups, and display groups

Parameters:
string$name
Returns:
void

Definition at line 2830 of file Form.php.

_addDisplayGroupObject ( Zend_Form_DisplayGroup $  group,
name = null 
) [protected]

Add a display group object (used with cloning)

Parameters:
Zend_Form_DisplayGroup$group
string | null$name
Returns:
Zend_Form

Definition at line 1712 of file Form.php.

_attachToArray ( value,
arrayPath 
) [protected]

Converts given arrayPath to an array and attaches given value at the end of it.

Parameters:
mixed$valueThe value to attach
string$arrayPathGiven array path to convert and attach to.
Returns:
array

Definition at line 1966 of file Form.php.

_dissolveArrayValue ( value,
arrayPath 
) [protected]

Extract the value by walking the array using given array path.

Given an array path such as foo[bar][baz], returns the value of the last element (in this case, 'baz').

Parameters:
array$valueArray to walk
string$arrayPathArray notation path of the part to extract
Returns:
string

Definition at line 1936 of file Form.php.

_getArrayName ( value ) [protected]

Determine array key name from given value

Given a value such as foo[bar][baz], returns the last element (in this case, 'baz').

Parameters:
string$value
Returns:
string

Definition at line 1906 of file Form.php.

_getDecorator ( name,
options 
) [protected]

Instantiate a decorator based on class name or class name fragment

Parameters:
string$name
null | array$options
Returns:
Zend_Form_Decorator_Interface

Definition at line 2348 of file Form.php.

_getErrorMessages (  ) [protected]

Retrieve optionally translated custom error messages

Returns:
array

Definition at line 3068 of file Form.php.

_loadDecorator ( array $  decorator,
name 
) [protected]

Lazy-load a decorator

Parameters:
array$decoratorDecorator type and options
mixed$nameDecorator name or alias
Returns:
Zend_Form_Decorator_Interface

Definition at line 3032 of file Form.php.

_setElementsBelongTo ( name = null ) [protected]

Set array to which elements belong

Parameters:
string$nameElement name
Returns:
void

Definition at line 1395 of file Form.php.

_sort (  ) [protected]

Sort items according to their order

Returns:
void

Definition at line 2997 of file Form.php.

addAttribs ( array $  attribs )

Add multiple form attributes at once

Parameters:
array$attribs
Returns:
Zend_Form

Definition at line 657 of file Form.php.

addDecorator ( decorator,
options = null 
)

Add a decorator for rendering the element

Parameters:
string | Zend_Form_Decorator_Interface$decorator
array | Zend_Config$optionsOptions with which to initialize decorator
Returns:
Zend_Form

Definition at line 2367 of file Form.php.

addDecorators ( array $  decorators )

Add many decorators at once

Parameters:
array$decorators
Returns:
Zend_Form

Definition at line 2409 of file Form.php.

addDisplayGroup ( array $  elements,
name,
options = null 
)

Add a display group

Groups named elements for display purposes.

If a referenced element does not yet exist in the form, it is omitted.

Parameters:
array$elements
string$name
array | Zend_Config$options
Returns:
Zend_Form
Exceptions:
Zend_Form_Exceptionif no valid elements provided

Definition at line 1651 of file Form.php.

addDisplayGroupPrefixPath ( prefix,
path 
)

Add prefix path for all display groups

Parameters:
string$prefix
string$path
Returns:
Zend_Form

Definition at line 584 of file Form.php.

addDisplayGroupPrefixPaths ( array $  spec )

Add multiple display group prefix paths at once

Parameters:
array$spec
Returns:
Zend_Form

Definition at line 604 of file Form.php.

addDisplayGroups ( array $  groups )

Add multiple display groups at once

Parameters:
array$groups
Returns:
Zend_Form

Definition at line 1739 of file Form.php.

addElement ( element,
name = null,
options = null 
)

Add a new element

$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:
string | Zend_Form_Element$element
string$name
array | Zend_Config$options
Returns:
Zend_Form

Definition at line 988 of file Form.php.

addElementPrefixPath ( prefix,
path,
type = null 
)

Add prefix path for all elements

Parameters:
string$prefix
string$path
string$type
Returns:
Zend_Form

Definition at line 541 of file Form.php.

addElementPrefixPaths ( array $  spec )

Add prefix paths for all elements

Parameters:
array$spec
Returns:
Zend_Form

Definition at line 566 of file Form.php.

addElements ( array $  elements )

Add multiple elements at once

Parameters:
array$elements
Returns:
Zend_Form

Definition at line 1089 of file Form.php.

addError ( message )

Add an error message and mark element as failed validation

Parameters:
string$message
Returns:
Zend_Form

Definition at line 2174 of file Form.php.

addErrorMessage ( message )

Add a custom error message to return in the event of failed validation

Parameters:
string$message
Returns:
Zend_Form

Definition at line 2103 of file Form.php.

addErrorMessages ( array $  messages )

Add multiple custom error messages to return in the event of failed validation

Parameters:
array$messages
Returns:
Zend_Form

Definition at line 2115 of file Form.php.

addErrors ( array $  messages )

Add multiple error messages and flag element as failed validation

Parameters:
array$messages
Returns:
Zend_Form

Definition at line 2187 of file Form.php.

addPrefixPath ( prefix,
path,
type = null 
)

Add prefix path for plugin loader

If no $type specified, assumes it is a base path for both filters and validators, and sets each according to the following rules:

  • decorators: $prefix = $prefix . '_Decorator'
  • elements: $prefix = $prefix . '_Element'

Otherwise, the path prefix is set on the appropriate plugin loader.

If $type is 'decorators', sets the path in the decorator plugin loader for all elements. Additionally, if no $type is provided, Zend_Form_Element::addPrefixPath() is called on each element.

Parameters:
string$prefix
string$path
string$type
Returns:
Zend_Form
Exceptions:
Zend_Form_Exceptionfor invalid type

Definition at line 477 of file Form.php.

addPrefixPaths ( array $  spec )

Add many prefix paths at once

Parameters:
array$spec
Returns:
Zend_Form

Definition at line 509 of file Form.php.

addSubForm ( Zend_Form form,
name,
order = null 
)

Add a form group/subform

Parameters:
Zend_Form$form
string$name
int$order
Returns:
Zend_Form

Definition at line 1462 of file Form.php.

addSubForms ( array $  subForms )

Add multiple form subForms/subforms at once

Parameters:
array$subForms
Returns:
Zend_Form

Definition at line 1505 of file Form.php.

clearAttribs (  )

Clear all form attributes

Returns:
Zend_Form

Definition at line 726 of file Form.php.

clearDecorators (  )

Clear all decorators

Returns:
Zend_Form

Definition at line 2536 of file Form.php.

clearDisplayGroups (  )

Remove all display groups

Returns:
Zend_Form

Definition at line 1864 of file Form.php.

clearElements (  )

Remove all form elements

Returns:
Zend_Form

Definition at line 1207 of file Form.php.

clearErrorMessages (  )

Clear custom error messages stack

Returns:
Zend_Form

Definition at line 2150 of file Form.php.

clearSubForms (  )

Remove all form subForms/subforms

Returns:
Zend_Form

Definition at line 1601 of file Form.php.

count (  )

Count of elements/subforms that are iterable

Returns:
int

Definition at line 2946 of file Form.php.

createElement ( type,
name,
options = null 
)

Create an element

Acts as a factory for creating elements. Elements created with this method will not be attached to the form, but will contain element settings as specified in the form object (including plugin loader prefix paths, default decorators, etc.).

Parameters:
string$type
string$name
array | Zend_Config$options
Returns:
Zend_Form_Element

Definition at line 1045 of file Form.php.

current (  )

Current element/subform/display group

Returns:
Zend_Form_Element|Zend_Form_DisplayGroup|Zend_Form

Definition at line 2879 of file Form.php.

filterName ( value,
allowBrackets = false 
)

Filter a name to only allow valid variable characters

Parameters:
string$value
bool$allowBrackets
Returns:
string

Definition at line 827 of file Form.php.

getAction (  )

Get form action

Sets default to '' if not set.

Returns:
string

Definition at line 750 of file Form.php.

getAttrib ( key )

Retrieve a single form attribute

Parameters:
string$key
Returns:
mixed

Definition at line 685 of file Form.php.

getAttribs (  )

Retrieve all form attributes/metadata

Returns:
array

Definition at line 700 of file Form.php.

getDecorator ( name )

Retrieve a registered decorator

Parameters:
string$name
Returns:
false|Zend_Form_Decorator_Abstract

Definition at line 2465 of file Form.php.

getDecorators (  )

Retrieve all decorators

Returns:
array

Definition at line 2496 of file Form.php.

getDefaultDisplayGroupClass (  )

Retrieve default display group class

Returns:
string

Definition at line 1633 of file Form.php.

static getDefaultTranslator (  ) [static]

Get global default translator object

Returns:
null|Zend_Translate

Definition at line 2719 of file Form.php.

getDescription (  )

Retrieve form description

Returns:
string

Definition at line 943 of file Form.php.

getDisplayGroup ( name )

Return a display group

Parameters:
string$name
Returns:
Zend_Form_DisplayGroup|null

Definition at line 1811 of file Form.php.

getDisplayGroups (  )

Return all display groups

Returns:
array

Definition at line 1826 of file Form.php.

getElement ( name )

Retrieve a single element

Parameters:
string$name
Returns:
Zend_Form_Element|null

Definition at line 1157 of file Form.php.

getElements (  )

Retrieve all elements

Returns:
array

Definition at line 1170 of file Form.php.

getElementsBelongTo (  )

Get name of array elements belong to

Returns:
string|null

Definition at line 1419 of file Form.php.

getEnctype (  )

Get encoding type

Returns:
string

Definition at line 811 of file Form.php.

getErrorMessages (  )

Retrieve custom error messages

Returns:
array

Definition at line 2140 of file Form.php.

getErrors ( name = null )

Get error codes for all elements failing validation

Parameters:
string$name
Returns:
array

Definition at line 2228 of file Form.php.

getFullyQualifiedName (  )

Get fully qualified name

Places name as subitem of array and/or appends brackets.

Returns:
string

Definition at line 870 of file Form.php.

getId (  )

Get element id

Returns:
string

Definition at line 880 of file Form.php.

getLegend (  )

Get form legend

Returns:
string

Definition at line 921 of file Form.php.

getMessages ( name = null,
suppressArrayNotation = false 
)

Retrieve error messages from elements failing validations

Parameters:
string$name
bool$suppressArrayNotation
Returns:
array

Definition at line 2254 of file Form.php.

getMethod (  )

Retrieve form method

Returns:
string

Definition at line 785 of file Form.php.

getName (  )

Get name attribute

Returns:
null|string

Definition at line 858 of file Form.php.

getOrder (  )

Get form order

Returns:
int|null

Definition at line 965 of file Form.php.

getPluginLoader ( type = null )

Retrieve plugin loader for given type

$type may be one of:

  • decorator
  • element

If a plugin loader does not exist for the given type, defaults are created.

Parameters:
string$type
Returns:
Zend_Loader_PluginLoader_Interface

Definition at line 430 of file Form.php.

getSubForm ( name )

Retrieve a form subForm/subform

Parameters:
string$name
Returns:
Zend_Form|null

Definition at line 1556 of file Form.php.

getSubForms (  )

Retrieve all form subForms/subforms

Returns:
array

Definition at line 1570 of file Form.php.

getTranslator (  )

Retrieve translator object

Returns:
Zend_Translate|null

Definition at line 2701 of file Form.php.

getUnfilteredValue ( name )

Get unfiltered element value

Parameters:
string$name
Returns:
mixed

Definition at line 1324 of file Form.php.

getUnfilteredValues (  )

Retrieve all unfiltered element values

Returns:
array

Definition at line 1337 of file Form.php.

getValue ( name )

Retrieve value for single element

Parameters:
string$name
Returns:
mixed

Definition at line 1274 of file Form.php.

getValues ( suppressArrayNotation = false )

Retrieve all form element values

Parameters:
bool$suppressArrayNotation
Returns:
array

Definition at line 1298 of file Form.php.

getView (  )

Retrieve view object

If none registered, attempts to pull from ViewRenderer.

Returns:
Zend_View_Interface|null

Definition at line 2330 of file Form.php.

init (  )

Initialize form (used by extending classes)

Returns:
void

Definition at line 294 of file Form.php.

isArray (  )

Get flag indicating if elements belong to an array

Returns:
bool

Definition at line 1447 of file Form.php.

isErrors (  )

Are there errors in the form?

Returns:
bool

Definition at line 2217 of file Form.php.

isValid ( data )

Validate the form

Parameters:
array$data
Returns:
boolean

Implements Zend_Validate_Interface.

Definition at line 1991 of file Form.php.

isValidPartial ( array $  data )

Validate a partial form

Does not check for required flags.

Parameters:
array$data
Returns:
boolean

Definition at line 2039 of file Form.php.

key (  )

Current element/subform/display group name

Returns:
string

Definition at line 2902 of file Form.php.

loadDefaultDecorators (  )

Load the default decorators

Returns:
void

Definition at line 2978 of file Form.php.

loadDefaultDecoratorsIsDisabled (  )

Should we load the default decorators?

Returns:
bool

Definition at line 2968 of file Form.php.

markAsError (  )

Mark the element as being in a failed validation state

Returns:
Zend_Form

Definition at line 2161 of file Form.php.

next (  )

Move pointer to next element/subform/display group

Returns:
void

Definition at line 2913 of file Form.php.

populate ( array $  values )

Populate form

Proxies to setDefaults()

Parameters:
array$values
Returns:
Zend_Form

Definition at line 1893 of file Form.php.

processAjax ( array $  data )

Process submitted AJAX data

Checks if provided $data is valid, via isValidPartial(). If so, it returns JSON-encoded boolean true. If not, it returns JSON-encoded error messages (as returned by getMessages()).

Parameters:
array$data
Returns:
string JSON-encoded boolean true or error messages

Definition at line 2087 of file Form.php.

removeAttrib ( key )

Remove attribute

Parameters:
string$key
Returns:
bool

Definition at line 711 of file Form.php.

removeDecorator ( name )

Remove a single decorator

Parameters:
string$name
Returns:
bool

Definition at line 2512 of file Form.php.

removeDisplayGroup ( name )

Remove a display group by name

Parameters:
string$name
Returns:
boolean

Definition at line 1837 of file Form.php.

removeElement ( name )

Remove element

Parameters:
string$name
Returns:
boolean

Definition at line 1181 of file Form.php.

removeSubForm ( name )

Remove form subForm/subform

Parameters:
string$name
Returns:
boolean

Definition at line 1581 of file Form.php.

render ( Zend_View_Interface view = null )

Render form

Parameters:
Zend_View_Interface$view
Returns:
string

Definition at line 2617 of file Form.php.

reset (  )

Reset values of form

Returns:
Zend_Form

Definition at line 277 of file Form.php.

rewind (  )

Move pointer to beginning of element/subform/display group loop

Returns:
void

Definition at line 2924 of file Form.php.

setAction ( action )

Set form action

Parameters:
string$action
Returns:
Zend_Form

Definition at line 738 of file Form.php.

setAttrib ( key,
value 
)

Set form attribute

Parameters:
string$key
mixed$value
Returns:
Zend_Form

Definition at line 644 of file Form.php.

setAttribs ( array $  attribs )

Set multiple form attributes at once

Overwrites any previously set attributes.

Parameters:
array$attribs
Returns:
Zend_Form

Definition at line 673 of file Form.php.

setConfig ( Zend_Config config )

Set form state from config object

Parameters:
Zend_Config$config
Returns:
Zend_Form

Definition at line 387 of file Form.php.

setDecorators ( array $  decorators )

Overwrite all decorators

Parameters:
array$decorators
Returns:
Zend_Form

Definition at line 2453 of file Form.php.

setDefault ( name,
value 
)

Set default value for an element

Parameters:
string$name
mixed$value
Returns:
Zend_Form

Definition at line 1251 of file Form.php.

setDefaultDisplayGroupClass ( class )

Set default display group class

Parameters:
string$class
Returns:
Zend_Form

Definition at line 1622 of file Form.php.

setDefaults ( array $  defaults )

Set default values for elements

Sets values for all elements specified in the array of $defaults.

Parameters:
array$defaults
Returns:
Zend_Form

Definition at line 1227 of file Form.php.

static setDefaultTranslator ( translator = null ) [static]

Set global default translator object

Parameters:
Zend_Translate | Zend_Translate_Adapter | null$translator
Returns:
void

Definition at line 2682 of file Form.php.

setDescription ( value )

Set form description

Parameters:
string$value
Returns:
Zend_Form

Definition at line 932 of file Form.php.

setDisableLoadDefaultDecorators ( flag )

Set flag to disable loading default decorators

Parameters:
bool$flag
Returns:
Zend_Form

Definition at line 2957 of file Form.php.

setDisableTranslator ( flag )

Indicate whether or not translation should be disabled

Parameters:
bool$flag
Returns:
Zend_Form

Definition at line 2741 of file Form.php.

setDisplayGroupDecorators ( array $  decorators )

Set all display group decorators as specified

Parameters:
array$decorators
Returns:
Zend_Form

Definition at line 2587 of file Form.php.

setDisplayGroups ( array $  groups )

Add multiple display groups (overwrites)

Parameters:
array$groups
Returns:
Zend_Form

Definition at line 1799 of file Form.php.

setElementDecorators ( array $  decorators,
array $  elements = null,
include = true 
)

Set all element decorators as specified

Parameters:
array$decorators
array | null$elementsSpecific elements to decorate or exclude from decoration
bool$includeWhether $elements is an inclusion or exclusion list
Returns:
Zend_Form

Definition at line 2550 of file Form.php.

setElementFilters ( array $  filters )

Set all elements' filters

Parameters:
array$filters
Returns:
Zend_Form

Definition at line 1353 of file Form.php.

setElements ( array $  elements )

Set form elements (overwrites existing elements)

Parameters:
array$elements
Returns:
Zend_Form

Definition at line 1145 of file Form.php.

setElementsBelongTo ( array )

Set name of array elements belong to

Parameters:
string$array
Returns:
Zend_Form

Definition at line 1367 of file Form.php.

setEnctype ( value )

Set encoding type

Parameters:
string$value
Returns:
Zend_Form

Definition at line 800 of file Form.php.

setErrorMessages ( array $  messages )

Same as addErrorMessages(), but clears custom error message stack first

Parameters:
array$messages
Returns:
Zend_Form

Definition at line 2129 of file Form.php.

setErrors ( array $  messages )

Overwrite any previously set error messages and flag as failed validation

Parameters:
array$messages
Returns:
Zend_Form

Definition at line 2201 of file Form.php.

setIsArray ( flag )

Set flag indicating elements belong to array

Parameters:
bool$flagValue of flag
Returns:
Zend_Form

Definition at line 1436 of file Form.php.

setLegend ( value )

Set form legend

Parameters:
string$value
Returns:
Zend_Form

Definition at line 910 of file Form.php.

setMethod ( method )

Set form method

Only values in $_methods() allowed

Parameters:
string$method
Returns:
Zend_Form
Exceptions:
Zend_Form_Exception

Definition at line 769 of file Form.php.

setName ( name )

Set form name

Parameters:
string$name
Returns:
Zend_Form

Definition at line 842 of file Form.php.

setOptions ( array $  options )

Set form state from options array

Parameters:
array$options
Returns:
Zend_Form

Definition at line 304 of file Form.php.

setOrder ( index )

Set form order

Parameters:
int$index
Returns:
Zend_Form

Definition at line 954 of file Form.php.

setPluginLoader ( Zend_Loader_PluginLoader_Interface loader,
type = null 
)

Set plugin loaders for use with decorators and elements

Parameters:
Zend_Loader_PluginLoader_Interface$loader
string$type'decorator' or 'element'
Returns:
Zend_Form
Exceptions:
Zend_Form_Exceptionon invalid type

Definition at line 403 of file Form.php.

setSubFormDecorators ( array $  decorators )

Set all subform decorators as specified

Parameters:
array$decorators
Returns:
Zend_Form

Definition at line 2602 of file Form.php.

setSubForms ( array $  subForms )

Set multiple form subForms/subforms (overwrites)

Parameters:
array$subForms
Returns:
Zend_Form

Definition at line 1544 of file Form.php.

setTranslator ( translator = null )

Set translator object

Parameters:
Zend_Translate | Zend_Translate_Adapter | null$translator
Returns:
Zend_Form

Definition at line 2660 of file Form.php.

setView ( Zend_View_Interface view = null )

Set view object

Parameters:
Zend_View_Interface$view
Returns:
Zend_Form

Reimplemented in ZendX_JQuery_Form.

Definition at line 2317 of file Form.php.

translatorIsDisabled (  )

Is translation disabled?

Returns:
bool

Definition at line 2752 of file Form.php.

valid (  )

Determine if current element/subform/display group is valid

Returns:
bool

Definition at line 2935 of file Form.php.


Field Documentation

const DECORATOR = 'DECORATOR'

#@+ Plugin loader type constants

Definition at line 38 of file Form.php.

const ENCTYPE_URLENCODED = 'application/x-www-form-urlencoded'

#@- #@+ Encoding type constants

Definition at line 54 of file Form.php.

const METHOD_DELETE = 'delete'

#@- #@+ Method type constants

Definition at line 45 of file Form.php.


The documentation for this class was generated from the following file: