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 |
Definition at line 33 of file Form.php.
__construct | ( | $ | options = null ) |
Constructor
Registers form view helper as decorator
mixed | $options |
Reimplemented in ZendX_JQuery_Form.
__call | ( | $ | method, |
$ | args | ||
) |
__clone | ( | ) |
__get | ( | $ | name ) |
__isset | ( | $ | name ) |
__set | ( | $ | name, |
$ | value | ||
) |
__toString | ( | ) |
__unset | ( | $ | name ) |
_addDisplayGroupObject | ( | Zend_Form_DisplayGroup $ | group, |
$ | name = null |
||
) | [protected] |
_attachToArray | ( | $ | value, |
$ | arrayPath | ||
) | [protected] |
_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').
array | $value | Array to walk |
string | $arrayPath | Array notation path of the part to extract |
_getArrayName | ( | $ | value ) | [protected] |
_getDecorator | ( | $ | name, |
$ | options | ||
) | [protected] |
_getErrorMessages | ( | ) | [protected] |
_loadDecorator | ( | array $ | decorator, |
$ | name | ||
) | [protected] |
_setElementsBelongTo | ( | $ | name = null ) |
[protected] |
_sort | ( | ) | [protected] |
addAttribs | ( | array $ | attribs ) |
addDecorator | ( | $ | decorator, |
$ | options = null |
||
) |
Add a decorator for rendering the element
string | Zend_Form_Decorator_Interface | $decorator | |
array | Zend_Config | $options | Options with which to initialize decorator |
addDecorators | ( | array $ | decorators ) |
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.
array | $elements | |
string | $name | |
array | Zend_Config | $options |
Zend_Form_Exception | if no valid elements provided |
addDisplayGroupPrefixPath | ( | $ | prefix, |
$ | path | ||
) |
addDisplayGroupPrefixPaths | ( | array $ | spec ) |
addDisplayGroups | ( | array $ | groups ) |
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.
string | Zend_Form_Element | $element | |
string | $name | |
array | Zend_Config | $options |
addElementPrefixPath | ( | $ | prefix, |
$ | path, | ||
$ | type = null |
||
) |
addElementPrefixPaths | ( | array $ | spec ) |
addElements | ( | array $ | elements ) |
addError | ( | $ | message ) |
addErrorMessage | ( | $ | message ) |
addErrorMessages | ( | array $ | messages ) |
addErrors | ( | array $ | messages ) |
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:
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.
string | $prefix | |
string | $path | |
string | $type |
Zend_Form_Exception | for invalid type |
addPrefixPaths | ( | array $ | spec ) |
addSubForm | ( | Zend_Form $ | form, |
$ | name, | ||
$ | order = null |
||
) |
addSubForms | ( | array $ | subForms ) |
clearAttribs | ( | ) |
clearDecorators | ( | ) |
clearDisplayGroups | ( | ) |
clearElements | ( | ) |
clearErrorMessages | ( | ) |
clearSubForms | ( | ) |
count | ( | ) |
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.).
string | $type | |
string | $name | |
array | Zend_Config | $options |
current | ( | ) |
filterName | ( | $ | value, |
$ | allowBrackets = false |
||
) |
getAction | ( | ) |
getAttrib | ( | $ | key ) |
getAttribs | ( | ) |
getDecorator | ( | $ | name ) |
getDefaultDisplayGroupClass | ( | ) |
static getDefaultTranslator | ( | ) | [static] |
getDescription | ( | ) |
getDisplayGroup | ( | $ | name ) |
getDisplayGroups | ( | ) |
getElement | ( | $ | name ) |
getElementsBelongTo | ( | ) |
getErrorMessages | ( | ) |
getErrors | ( | $ | name = null ) |
getFullyQualifiedName | ( | ) |
getMessages | ( | $ | name = null , |
$ | suppressArrayNotation = false |
||
) |
getPluginLoader | ( | $ | type = null ) |
Retrieve plugin loader for given type
$type may be one of:
If a plugin loader does not exist for the given type, defaults are created.
string | $type |
getSubForm | ( | $ | name ) |
getSubForms | ( | ) |
getTranslator | ( | ) |
getUnfilteredValue | ( | $ | name ) |
getUnfilteredValues | ( | ) |
getValue | ( | $ | name ) |
getValues | ( | $ | suppressArrayNotation = false ) |
getView | ( | ) |
Retrieve view object
If none registered, attempts to pull from ViewRenderer.
init | ( | ) |
isArray | ( | ) |
isValid | ( | $ | data ) |
isValidPartial | ( | array $ | data ) |
key | ( | ) |
loadDefaultDecorators | ( | ) |
loadDefaultDecoratorsIsDisabled | ( | ) |
markAsError | ( | ) |
next | ( | ) |
populate | ( | array $ | values ) |
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()).
array | $data |
removeAttrib | ( | $ | key ) |
removeDecorator | ( | $ | name ) |
removeDisplayGroup | ( | $ | name ) |
removeElement | ( | $ | name ) |
removeSubForm | ( | $ | name ) |
render | ( | Zend_View_Interface $ | view = null ) |
rewind | ( | ) |
setAction | ( | $ | action ) |
setAttrib | ( | $ | key, |
$ | value | ||
) |
setAttribs | ( | array $ | attribs ) |
setConfig | ( | Zend_Config $ | config ) |
setDecorators | ( | array $ | decorators ) |
setDefault | ( | $ | name, |
$ | value | ||
) |
setDefaultDisplayGroupClass | ( | $ | class ) |
setDefaults | ( | array $ | defaults ) |
static setDefaultTranslator | ( | $ | translator = null ) |
[static] |
Set global default translator object
Zend_Translate | Zend_Translate_Adapter | null | $translator |
setDescription | ( | $ | value ) |
setDisableLoadDefaultDecorators | ( | $ | flag ) |
setDisableTranslator | ( | $ | flag ) |
setDisplayGroupDecorators | ( | array $ | decorators ) |
setDisplayGroups | ( | array $ | groups ) |
setElementDecorators | ( | array $ | decorators, |
array $ | elements = null , |
||
$ | include = true |
||
) |
setElementFilters | ( | array $ | filters ) |
setElements | ( | array $ | elements ) |
setElementsBelongTo | ( | $ | array ) |
setEnctype | ( | $ | value ) |
setErrorMessages | ( | array $ | messages ) |
Same as addErrorMessages(), but clears custom error message stack first
array | $messages |
setErrors | ( | array $ | messages ) |
setIsArray | ( | $ | flag ) |
setLegend | ( | $ | value ) |
setMethod | ( | $ | method ) |
Set form method
Only values in $_methods() allowed
string | $method |
Zend_Form_Exception |
setName | ( | $ | name ) |
setOptions | ( | array $ | options ) |
setOrder | ( | $ | index ) |
setPluginLoader | ( | Zend_Loader_PluginLoader_Interface $ | loader, |
$ | type = null |
||
) |
Set plugin loaders for use with decorators and elements
Zend_Loader_PluginLoader_Interface | $loader | |
string | $type | 'decorator' or 'element' |
Zend_Form_Exception | on invalid type |
setSubFormDecorators | ( | array $ | decorators ) |
setSubForms | ( | array $ | subForms ) |
setTranslator | ( | $ | translator = null ) |
Set translator object
Zend_Translate | Zend_Translate_Adapter | null | $translator |
setView | ( | Zend_View_Interface $ | view = null ) |
Set view object
Zend_View_Interface | $view |
Reimplemented in ZendX_JQuery_Form.
translatorIsDisabled | ( | ) |
valid | ( | ) |
const ENCTYPE_URLENCODED = 'application/x-www-form-urlencoded' |
const METHOD_DELETE = 'delete' |