Form/Element.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Form
Package: Zend_Form\ElementZend_Form_Element
- Implements
- Children
- \Zend_Dojo_Form_Element_Dijit
- \Zend_Form_Element_Xhtml
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Version
- $Id$
Constants
Properties
Methods



__call(string $method, array $args) : stringOverloading: allow rendering specific decorators
Call renderDecoratorName() to render a specific decorator.
Parameters| Name | Type | Description |
|---|
| $method | string | |
|---|
| $args | array | |
|---|
ReturnsThrows


__get(string $key) : mixedOverloading: retrieve object property
Prevents access to properties beginning with '_'.
Parameters| Name | Type | Description |
|---|
| $key | string | |
|---|
Returns


__set(string $key, mixed $value) : \voideOverloading: set object property
Parameters| Name | Type | Description |
|---|
| $key | string | |
|---|
| $value | mixed | |
|---|
Returns 


__toString() : stringString representation of form element
Proxies to {@link render()}.
Returns


_getDecorator(string $name, null | array $options) : \Zend_Form_Decorator_InterfaceInstantiate a decorator based on class name or class name fragment
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
| $options | null | array | |
|---|
Returns 


_loadDecorator(array $decorator, mixed $name) : \Zend_Form_Decorator_InterfaceParameters| Name | Type | Description |
|---|
| $decorator | array | Decorator type and options |
|---|
| $name | mixed | Decorator name or alias |
|---|
Returns 


_loadValidator(array $validator) : \Zend_Validate_InterfaceParameters| Name | Type | Description |
|---|
| $validator | array | Validator definition |
|---|
Returns 


addDecorators(array $decorators) : \Zend_Form_ElementAdd many decorators at once
Parameters| Name | Type | Description |
|---|
| $decorators | array | |
|---|
Returns 


addError(string $message) : \Zend_Form_ElementAdd an error message and mark element as failed validation
Parameters| Name | Type | Description |
|---|
| $message | string | |
|---|
Returns 


addErrorMessage(string $message) : \Zend_Form_ElementAdd a custom error message to return in the event of failed validation
Parameters| Name | Type | Description |
|---|
| $message | string | |
|---|
Returns 


addErrorMessages(array $messages) : \Zend_Form_ElementAdd multiple custom error messages to return in the event of failed validation
Parameters| Name | Type | Description |
|---|
| $messages | array | |
|---|
Returns 


addErrors(array $messages) : \Zend_Form_ElementAdd multiple error messages and flag element as failed validation
Parameters| Name | Type | Description |
|---|
| $messages | array | |
|---|
Returns 


addPrefixPath(string $prefix, string $path, string $type = null) : \Zend_Form_ElementAdd 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'
- filters: $prefix = $prefix . '_Filter'
- validators: $prefix = $prefix . '_Validate'
Otherwise, the path prefix is set on the appropriate plugin loader.
Parameters| Name | Type | Description |
|---|
| $prefix | string | |
|---|
| $path | string | |
|---|
| $type | string | |
|---|
ReturnsThrows


addPrefixPaths(array $spec) : \Zend_Form_ElementAdd many prefix paths at once
Parameters| Name | Type | Description |
|---|
| $spec | array | |
|---|
Returns 


addValidator(string | \Zend_Validate_Interface $validator, bool $breakChainOnFailure = false, array $options = array()) : \Zend_Form_ElementAdd validator to validation chain
Note: will overwrite existing validators if they are of the same class.
ParametersReturnsThrows


filterName(string $value, bool $allowBrackets = false) : stringFilter a name to only allow valid variable characters
Parameters| Name | Type | Description |
|---|
| $value | string | |
|---|
| $allowBrackets | bool | |
|---|
Returns 


getAttrib(string $name) : stringRetrieve element attribute
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
Returns 


getFilter(string $name) : \Zend_Filter_InterfaceRetrieve a single filter by name
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
Returns 


getPluginLoader(string $type) : \Zend_Loader_PluginLoaderRetrieve plugin loader for validator or filter chain
Instantiates with default rules if none available for that type. Use
'decorator', 'filter', or 'validate' for $type.
Parameters| Name | Type | Description |
|---|
| $type | string | |
|---|
ReturnsThrows


getValidator(string $name) : \Zend_Validate_Interface | falseRetrieve a single validator by name
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
Returns 


removeDecorator(string $name) : \Zend_Form_ElementRemove a single decorator
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
Returns 


removeValidator(string $name) : boolRemove a single validator by name
Parameters| Name | Type | Description |
|---|
| $name | string | |
|---|
Returns 


resolveElementId(\Zend_Form_Decorator_Interface $decorator) : stringstaticUsed to resolve and return an element ID
Passed to the HtmlTag decorator as a callback in order to provide an ID.
ParametersReturns


setAttribs(array $attribs) : \Zend_Form_ElementSet multiple attributes at once
Parameters| Name | Type | Description |
|---|
| $attribs | array | |
|---|
Returns 


setAutoInsertNotEmptyValidator(bool $flag) : \Zend_Form_ElementSet flag indicating whether a NotEmpty validator should be inserted when element is required
Parameters| Name | Type | Description |
|---|
| $flag | bool | |
|---|
Returns 


setBelongsTo(string $array) : \Zend_Form_ElementSet array to which element belongs
Parameters| Name | Type | Description |
|---|
| $array | string | |
|---|
Returns 


setConcatJustValuesInErrorMessage(boolean $concatJustValuesInErrorMessage) : \Zend_Form_ElementUse one error message for array elements with concatenated values
Parameters| Name | Type | Description |
|---|
| $concatJustValuesInErrorMessage | boolean | |
|---|
Returns 


setDisableLoadDefaultDecorators(bool $flag) : \Zend_Form_ElementSet flag to disable loading default decorators
Parameters| Name | Type | Description |
|---|
| $flag | bool | |
|---|
Returns 


setDisableTranslator(bool $flag) : \Zend_Form_ElementIndicate whether or not translation should be disabled
Parameters| Name | Type | Description |
|---|
| $flag | bool | |
|---|
Returns 


setErrorMessageSeparator(string $separator) : \Zend_Form_ElementSet errorMessageSeparator
Parameters| Name | Type | Description |
|---|
| $separator | string | |
|---|
Returns 


setErrorMessages(array $messages) : \Zend_Form_ElementSame as addErrorMessages(), but clears custom error message stack first
Parameters| Name | Type | Description |
|---|
| $messages | array | |
|---|
Returns 


setErrors(array $messages) : \Zend_Form_ElementOverwrite any previously set error messages and flag as failed validation
Parameters| Name | Type | Description |
|---|
| $messages | array | |
|---|
Returns 


setFilters(array $filters) : \Zend_Form_ElementAdd filters to element, overwriting any already existing
Parameters| Name | Type | Description |
|---|
| $filters | array | |
|---|
Returns 


setIgnore(bool $flag) : \Zend_Form_ElementSet ignore flag (used when retrieving values at form level)
Parameters| Name | Type | Description |
|---|
| $flag | bool | |
|---|
Returns 


setIsArray(bool $flag) : \Zend_Form_ElementSet flag indicating if element represents an array
Parameters| Name | Type | Description |
|---|
| $flag | bool | |
|---|
Returns 


setOptions(array $options) : \Zend_Form_ElementSet object state from options array
Parameters| Name | Type | Description |
|---|
| $options | array | |
|---|
Returns 


setRequired(bool $flag = true) : \Zend_Form_ElementParameters| Name | Type | Description |
|---|
| $flag | bool | Default value is true |
|---|
Returns 


setValidators(array $validators) : \Zend_Form_ElementSet multiple validators, overwriting previous validators
Parameters| Name | Type | Description |
|---|
| $validators | array | |
|---|
Returns