Zend_Form
category | Zend |
---|---|
package | Zend_Form |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
version | $Id$ |
__call(string $method, array $args) : string
Call renderDecoratorName() to render a specific decorator.
string
array
\Zend_Form_Exception |
for invalid decorator or invalid method call |
---|
string
__clone() : void
__construct(mixed $options = null
)
Registers form view helper as decorator
mixed
__get(string $name) : \Zend_Form_Element | \Zend_Form | null
string
\Zend_Form_Element
\Zend_Form
null
__isset(string $name) : boolean
string
boolean
__set(string $name, \Zend_Form_Element|\Zend_Form $value) : void
string
\Zend_Form_Element
\Zend_Form
\Zend_Form_Exception |
for invalid $value |
---|
__toString() : string
Proxies to \render().
string
__unset(string $name) : void
string
addAttribs(array $attribs) : \Zend_Form
array
\Zend_Form
addDecorator(string|\Zend_Form_Decorator_Interface $decorator, array|\Zend_Config $options = null
) : \Zend_Form
string
\Zend_Form_Decorator_Interface
array
\Zend_Config
Options with which to initialize decorator
\Zend_Form_Exception |
---|
\Zend_Form
addDecorators(array $decorators) : \Zend_Form
array
\Zend_Form_Exception |
---|
\Zend_Form
addDisplayGroup(array $elements, string $name, array|\Zend_Config $options = null
) : \Zend_Form
Groups named elements for display purposes.
If a referenced element does not yet exist in the form, it is omitted.
array
string
array
\Zend_Config
\Zend_Form_Exception |
if no valid elements provided |
---|
\Zend_Form
addDisplayGroupPrefixPath(string $prefix, string $path) : \Zend_Form
string
string
\Zend_Form
addDisplayGroupPrefixPaths(array $spec) : \Zend_Form
array
\Zend_Form
addDisplayGroups(array $groups) : \Zend_Form
array
\Zend_Form
addElement(string|\Zend_Form_Element $element, string $name= null
, array|\Zend_Config $options= null
) : \Zend_Form
$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
string
array
\Zend_Config
\Zend_Form_Exception |
on invalid element |
---|
\Zend_Form
addElementPrefixPath(string $prefix, string $path, string $type = null
) : \Zend_Form
string
string
string
\Zend_Form
addElementPrefixPaths(array $spec) : \Zend_Form
array
\Zend_Form
addElements(array $elements) : \Zend_Form
array
\Zend_Form
addError(string $message) : \Zend_Form
string
\Zend_Form
addErrorMessage(string $message) : \Zend_Form
string
\Zend_Form
addErrorMessages(array $messages) : \Zend_Form
array
\Zend_Form
addErrors(array $messages) : \Zend_Form
array
\Zend_Form
addPrefixPath(string $prefix, string $path, string $type = null
) : \Zend_Form
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 'decorator', sets the path in the decorator plugin loader for all elements. Additionally, if no $type is provided, the prefix and path is added to both decorator and element plugin loader with following settings: $prefix . '_Decorator', $path . '/Decorator/' $prefix . '_Element', $path . '/Element/'
string
string
string
\Zend_Form_Exception |
for invalid type |
---|
\Zend_Form
addPrefixPaths(array $spec) : \Zend_Form
array
\Zend_Form
addSubForm(\Zend_Form $form, string $name, integer $order = null
) : \Zend_Form
\Zend_Form
string
integer
\Zend_Form
addSubForms(array $subForms) : \Zend_Form
array
\Zend_Form
clearAttribs() : \Zend_Form
\Zend_Form
clearDecorators() : \Zend_Form
\Zend_Form
clearDisplayGroups() : \Zend_Form
\Zend_Form
clearElements() : \Zend_Form
\Zend_Form
clearErrorMessages() : \Zend_Form
\Zend_Form
clearSubForms() : \Zend_Form
\Zend_Form
count() : integer
integer
createElement(string $type, string $name, array|\Zend_Config $options = null
) : \Zend_Form_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
string
array
\Zend_Config
\Zend_Form_Exception |
---|
\Zend_Form_Element
current() : \Zend_Form_Element | \Zend_Form_DisplayGroup | \Zend_Form
\Zend_Form_Exception |
---|
\Zend_Form_Element
\Zend_Form_DisplayGroup
\Zend_Form
filterName(string $value, boolean $allowBrackets = false
) : string
string
boolean
string
getAction() : string
Sets default to '' if not set.
string
getAttrib(string $key) : mixed
string
mixed
getAttribs() : array
array
getCustomMessages() : array
array
getDecorator(string $name) : false | \Zend_Form_Decorator_Abstract
string
false
\Zend_Form_Decorator_Abstract
getDecorators() : array
array
getDefaultDisplayGroupClass() : string
string
getDefaultTranslator() : null | \Zend_Translate
null
\Zend_Translate
getDescription() : string
string
getDisplayGroup(string $name) : \Zend_Form_DisplayGroup | null
string
\Zend_Form_DisplayGroup
null
getDisplayGroups() : array
array
getElement(string $name) : \Zend_Form_Element | null
string
\Zend_Form_Element
null
getElements() : array
array
getElementsAndSubFormsOrdered() : array
Subitems are inserted based on their order Setting if set, otherwise they are appended, the resulting numerical index may differ from the order value.
access | protected |
---|
array
getElementsBelongTo() : string | null
string
null
getEnctype() : string
string
getErrorMessages() : array
array
getErrors(string $name= null
, boolean $suppressArrayNotation= false
) : array
string
boolean
array
getFullyQualifiedName() : string
Places name as subitem of array and/or appends brackets.
string
getId() : string
string
getLegend() : string
string
getMessages(string $name= null
, boolean $suppressArrayNotation= false
) : array
If isValid() was never called or if the most recent isValid() call returned true, then this method returns an empty array.
inherited_from | \Zend_Validate_Interface::getMessages() |
---|
string
boolean
array
getMethod() : string
string
getName() : null | string
null
string
getOrder() : integer | null
integer
null
getPluginLoader(string $type = null
) : \Zend_Loader_PluginLoader_Interface
$type may be one of:
If a plugin loader does not exist for the given type, defaults are created.
string
\Zend_Form_Exception |
---|
\Zend_Loader_PluginLoader_Interface
getSubForm(string $name) : \Zend_Form | null
string
\Zend_Form
null
getSubForms() : array
array
getTranslator() : \Zend_Translate | null
\Zend_Translate
null
getUnfilteredValue(string $name) : mixed
string
mixed
getUnfilteredValues() : array
array
getValidValues(array $data, boolean $suppressArrayNotation = false
) : array
For models that can be saved in a partially valid state, for example when following the builder, prototype or state patterns it is particularly interessting to retrieve all the current valid values to persist them.
array
boolean
array
getValue(string $name) : mixed
string
mixed
getValues(boolean $suppressArrayNotation = false
) : array
boolean
array
getView() : \Zend_View_Interface | null
If none registered, attempts to pull from ViewRenderer.
\Zend_View_Interface
null
hasDefaultTranslator() : boolean
boolean
hasErrors() : boolean
boolean
hasTranslator() : boolean
boolean
init() : void
isArray() : boolean
boolean
isErrors() : boolean
deprecated | since 1.11.1 - use hasErrors() instead |
---|
boolean
isValid(array $data) : boolean
If $value fails validation, then this method returns false, and getMessages() will return an array of messages that explain why the validation failed.
inherited_from | \Zend_Validate_Interface::isValid() |
---|
array
\Zend_Form_Exception |
---|
boolean
isValidPartial(array $data) : boolean
Does not check for required flags.
array
boolean
key() : string
string
loadDefaultDecorators() : \Zend_Form
\Zend_Form
loadDefaultDecoratorsIsDisabled() : boolean
boolean
markAsError() : \Zend_Form
\Zend_Form
next() : void
persistData()
populate(array $values) : \Zend_Form
Proxies to \setDefaults()
array
\Zend_Form
processAjax(array $data) : string
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
string
JSON-encoded boolean true or error messagesremoveAttrib(string $key) : boolean
string
boolean
removeDecorator(string $name) : boolean
string
boolean
removeDisplayGroup(string $name) : boolean
string
boolean
removeElement(string $name) : boolean
string
boolean
removeFromIteration(string $name) : void
string
Element/group/form name
removeSubForm(string $name) : boolean
string
boolean
render(\Zend_View_Interface $view = null
) : string
\Zend_View_Interface
string
reset() : \Zend_Form
\Zend_Form
rewind() : void
setAction(string $action) : \Zend_Form
string
\Zend_Form
setAttrib(string $key, mixed $value) : \Zend_Form
string
mixed
\Zend_Form
setAttribs(array $attribs) : \Zend_Form
Overwrites any previously set attributes.
array
\Zend_Form
setConfig(\Zend_Config $config) : \Zend_Form
\Zend_Config
\Zend_Form
setDecorators(array $decorators) : \Zend_Form
array
\Zend_Form
setDefault(string $name, mixed $value) : \Zend_Form
string
mixed
\Zend_Form
setDefaultDisplayGroupClass(string $class) : \Zend_Form
string
\Zend_Form
setDefaultTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
) : void
\Zend_Translate
\Zend_Translate_Adapter
null
\Zend_Form_Exception |
---|
setDefaults(array $defaults) : \Zend_Form
Sets values for all elements specified in the array of $defaults.
array
\Zend_Form
setDescription(string $value) : \Zend_Form
string
\Zend_Form
setDisableLoadDefaultDecorators(boolean $flag) : \Zend_Form
boolean
\Zend_Form
setDisableTranslator(boolean $flag) : \Zend_Form
boolean
\Zend_Form
setDisplayGroupDecorators(array $decorators) : \Zend_Form
array
\Zend_Form
setDisplayGroups(array $groups) : \Zend_Form
array
\Zend_Form
setElementDecorators(array $decorators, array|null $elements= null
, boolean $include= true
) : \Zend_Form
array
array
null
Specific elements to decorate or exclude from decoration
boolean
Whether $elements is an inclusion or exclusion list
\Zend_Form
setElementFilters(array $filters) : \Zend_Form
array
\Zend_Form
setElements(array $elements) : \Zend_Form
array
\Zend_Form
setElementsBelongTo(string $array) : \Zend_Form
string
\Zend_Form
setEnctype(string $value) : \Zend_Form
string
\Zend_Form
setErrorMessages(array $messages) : \Zend_Form
array
\Zend_Form
setErrors(array $messages) : \Zend_Form
array
\Zend_Form
setIsArray(boolean $flag) : \Zend_Form
boolean
Value of flag
\Zend_Form
setLegend(string $value) : \Zend_Form
string
\Zend_Form
setMethod(string $method) : \Zend_Form
Only values in \$_methods() allowed
string
\Zend_Form_Exception |
---|
\Zend_Form
setName(string $name) : \Zend_Form
string
\Zend_Form_Exception |
---|
\Zend_Form
setOptions(array $options) : \Zend_Form
array
\Zend_Form
setOrder(integer $index) : \Zend_Form
integer
\Zend_Form
setPluginLoader(\Zend_Loader_PluginLoader_Interface $loader, string $type = null
) : \Zend_Form
\Zend_Loader_PluginLoader_Interface
string
'decorator' or 'element'
\Zend_Form_Exception |
on invalid type |
---|
\Zend_Form
setSubFormDecorators(array $decorators) : \Zend_Form
array
\Zend_Form
setSubForms(array $subForms) : \Zend_Form
array
\Zend_Form
setTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
) : \Zend_Form
\Zend_Translate
\Zend_Translate_Adapter
null
\Zend_Form_Exception |
---|
\Zend_Form
setView(\Zend_View_Interface $view = null
) : \Zend_Form
\Zend_View_Interface
\Zend_Form
translatorIsDisabled() : boolean
boolean
valid() : boolean
boolean
_addDisplayGroupObject(\Zend_Form_DisplayGroup $group, string|null $name = null
) : \Zend_Form
\Zend_Form_DisplayGroup
string
null
\Zend_Form_Exception |
---|
\Zend_Form
_array_replace_recursive(array $into) : array
array
array
_attachToArray(mixed $value, string $arrayPath) : array
mixed
The value to attach
string
Given array path to convert and attach to.
array
_dissolveArrayUnsetKey(array $array, string|null $arrayPath, string $key) : array
array
string
null
string
array
_dissolveArrayValue(array $value, string $arrayPath) : string
Given an array path such as foo[bar][baz], returns the value of the last element (in this case, 'baz').
array
Array to walk
string
Array notation path of the part to extract
string
_getArrayName(string $value) : string
Given a value such as foo[bar][baz], returns the last element (in this case, 'baz').
string
string
_getDecorator(string $name, null|array $options) : \Zend_Form_Decorator_Interface
string
null
array
\Zend_Form_Decorator_Interface
_getErrorMessages() : array
array
_getIsRendered()
_loadDecorator(array $decorator, mixed $name) : \Zend_Form_Decorator_Interface
array
Decorator type and options
mixed
Decorator name or alias
\Zend_Form_Decorator_Interface
_setElementsBelongTo(string $name = null
) : void
string
Element name
_setIsRendered()
_sort() : void
\Zend_Form_Exception |
---|
$_attribs : array
array()
$_decorators : array
array()
$_defaultDisplayGroupClass : string
'Zend_Form_DisplayGroup'
$_description : string
$_disableLoadDefaultDecorators : boolean
false
$_displayGroupPrefixPaths : array
array()
$_displayGroups : array
array()
$_elementDecorators : null | array
$_elementPrefixPaths : array
array()
$_elements : array
array()
$_elementsBelongTo : string
$_errorMessages : array
array()
$_errorsExist : boolean
false
$_errorsForced : boolean
false
$_formOrder : integer | null
$_isArray : boolean
false
$_isRendered : boolean
false
$_legend : string
$_loaders : array
array()
$_methods : array
array('delete', 'get', 'post', 'put')
$_order : array
array()
$_orderUpdated : boolean
false
$_subFormPrefixPaths : array
array()
$_subForms : array
array()
$_translator : \Zend_Translate
$_translatorDefault : \Zend_Translate
$_translatorDisabled : boolean
false
$_view : \Zend_View_Interface
DECORATOR = 'DECORATOR'
ELEMENT = 'ELEMENT'
ENCTYPE_MULTIPART = 'multipart/form-data'
ENCTYPE_URLENCODED = 'application/x-www-form-urlencoded'
METHOD_DELETE = 'delete'
METHOD_GET = 'get'
METHOD_POST = 'post'
METHOD_PUT = 'put'