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.
Zend_Form_Element
DECORATOR = 'DECORATOR'
Element Constants
Details FILTER = 'FILTER'
Details VALIDATE = 'VALIDATE'
Detailsbool $_allowEmpty = 'true''Allow empty' flag
Detailsbool $_autoInsertNotEmptyValidator = 'true'Flag indicating whether or not to insert NotEmpty validator when element is required
Detailsstring $_belongsTo = ''Array to which element belongs
Detailsarray $_decorators = 'array'Element decorators
Detailsstring $_description = ''Element description
Detailsbool $_disableLoadDefaultDecorators = 'false'Should we disable loading the default decorators?
Detailsstring $_errorMessageSeparator = '; 'Separator to use when concatenating aggregate error messages (for elements having array values)
Detailsarray $_errorMessages = 'array'Custom error messages
Detailsarray $_errors = 'array'Validation errors
Detailsarray $_filters = 'array'Element filters
Detailsbool $_ignore = 'false'Ignore flag (used when retrieving values at form level)
Detailsbool $_isArray = 'false'Does the element represent an array?
Detailsbool $_isError = 'false'Is the error marked as in an invalid state?
Detailsbool $_isErrorForced = 'false'Has the element been manually marked as invalid?
Detailsbool $_isPartialRendering = 'false'Is a specific decorator being rendered via the magic renderDecorator()?
This is to allow execution of logic inside the render() methods of child elements during the magic call while skipping the parent render() method.
Detailsstring $_label = ''Element label
Detailsarray $_loaders = 'array'Plugin loaders for filter and validator chains
Detailsarray $_messages = 'array'Formatted validation error messages
Detailsstring $_name = ''Element name
Detailsint $_order = ''Order of element
Detailsbool $_required = 'false'Required flag
DetailsZend_Translate $_translator = ''
Detailsbool $_translatorDisabled = 'false'Is translation disabled?
Detailsstring $_type = ''Element type
Detailsarray $_validatorRules = 'array'Array of un-initialized validators
Detailsarray $_validators = 'array'Array of initialized validators
Detailsmixed $_value = ''Element value
DetailsZend_View_Interface $_view = ''
Detailsstring $helper = 'formText'Default view helper to use
Details__call(
string $method, array $args
)
:
stringOverloading: allow rendering specific decorators
Call renderDecoratorName() to render a specific decorator.
Details__construct(
string|array|Zend_Config $spec, array|Zend_Config $options
=
null
)
:
voidConstructor
$spec may be: - string: name of element - array: options with which to configure element - Zend_Config: Zend_Config with options for configuring element
Details__get(
string $key
)
:
mixedOverloading: retrieve object property
Prevents access to properties beginning with '_'.
Details__set(
string $key, mixed $value
)
:
voideOverloading: set object property
Details__toString(
)
:
stringString representation of form element
Proxies to {@link render()}.
Details_filterValue(
string $value, string $key
)
:
voidFilter a value
Details_getDecorator(
string $name, null|array $options
)
:
Zend_Form_Decorator_InterfaceInstantiate a decorator based on class name or class name fragment
Details_getErrorMessages(
)
:
arrayRetrieve error messages and perform translation and value substitution
Details_hasErrorMessages(
)
:
boolAre there custom error messages registered?
Details_loadDecorator(
array $decorator, mixed $name
)
:
Zend_Form_Decorator_InterfaceLazy-load a decorator
Details_loadFilter(
array $filter
)
:
Zend_Filter_InterfaceLazy-load a filter
Details_loadValidator(
array $validator
)
:
Zend_Validate_InterfaceLazy-load a validator
DetailsaddDecorator(
string|Zend_Form_Decorator_Interface $decorator, array|Zend_Config $options
=
null
)
:
Zend_Form_ElementAdd a decorator for rendering the element
DetailsaddDecorators(
array $decorators
)
:
Zend_Form_ElementAdd many decorators at once
DetailsaddError(
string $message
)
:
Zend_Form_ElementAdd an error message and mark element as failed validation
DetailsaddErrorMessage(
string $message
)
:
Zend_Form_ElementAdd a custom error message to return in the event of failed validation
DetailsaddErrorMessages(
array $messages
)
:
Zend_Form_ElementAdd multiple custom error messages to return in the event of failed validation
DetailsaddErrors(
array $messages
)
:
Zend_Form_ElementAdd multiple error messages and flag element as failed validation
DetailsaddFilter(
string|Zend_Filter_Interface $filter, $options
=
array
)
:
Zend_Form_ElementAdd a filter to the element
DetailsaddFilters(
array $filters
)
:
Zend_Form_ElementAdd filters to element
DetailsaddPrefixPath(
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.
DetailsaddPrefixPaths(
array $spec
)
:
Zend_Form_ElementAdd many prefix paths at once
DetailsaddValidator(
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.
DetailsaddValidators(
array $validators
)
:
Zend_Form_ElementAdd multiple validators
DetailsautoInsertNotEmptyValidator(
)
:
boolGet flag indicating whether a NotEmpty validator should be inserted when element is required
DetailsclearDecorators(
)
:
Zend_Form_ElementClear all decorators
DetailsclearErrorMessages(
)
:
Zend_Form_ElementClear custom error messages stack
DetailsclearFilters(
)
:
Zend_Form_ElementClear all filters
DetailsclearValidators(
)
:
Zend_Form_ElementClear all validators
DetailsfilterName(
string $value, bool $allowBrackets
=
false
)
:
stringFilter a name to only allow valid variable characters
DetailsgetAllowEmpty(
)
:
boolGet 'allow empty' flag
DetailsgetAttrib(
string $name
)
:
stringRetrieve element attribute
DetailsgetAttribs(
)
:
arrayReturn all attributes
DetailsgetBelongsTo(
)
:
stringReturn array name to which element belongs
DetailsgetDecorator(
string $name
)
:
false|Zend_Form_Decorator_AbstractRetrieve a registered decorator
DetailsgetDecorators(
)
:
arrayRetrieve all decorators
DetailsgetDescription(
)
:
stringRetrieve element description
DetailsgetErrorMessageSeparator(
)
:
stringGet errorMessageSeparator
DetailsgetErrorMessages(
)
:
arrayRetrieve custom error messages
DetailsgetErrors(
)
:
arrayRetrieve validator chain errors
DetailsgetFilter(
string $name
)
:
Zend_Filter_InterfaceRetrieve a single filter by name
DetailsgetFilters(
)
:
arrayGet all filters
DetailsgetFullyQualifiedName(
)
:
stringGet fully qualified name
Places name as subitem of array and/or appends brackets.
DetailsgetId(
)
:
stringGet element id
DetailsgetIgnore(
)
:
boolGet ignore flag (used when retrieving values at form level)
DetailsgetLabel(
)
:
stringRetrieve element label
DetailsgetMessages(
)
:
arrayRetrieve error messages
DetailsgetName(
)
:
stringReturn element name
DetailsgetOrder(
)
:
intRetrieve element order
DetailsgetPluginLoader(
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.
DetailsgetTranslator(
)
:
Zend_Translate_Adapter|nullRetrieve localization translator object
DetailsgetType(
)
:
stringReturn element type
DetailsgetUnfilteredValue(
)
:
mixedRetrieve unfiltered element value
DetailsgetValidator(
string $name
)
:
Zend_Validate_Interface|falseRetrieve a single validator by name
DetailsgetValidators(
)
:
arrayRetrieve all validators
DetailsgetValue(
)
:
mixedRetrieve filtered element value
DetailsgetView(
)
:
null|Zend_View_InterfaceRetrieve view object
Retrieves from ViewRenderer if none previously set.
DetailshasErrors(
)
:
boolAre there errors registered?
DetailshasTranslator(
)
:
boolDoes this element have its own specific translator?
Detailsinit(
)
:
voidInitialize object; used by extending classes
DetailsisArray(
)
:
boolIs the element representing an array?
DetailsisRequired(
)
:
boolIs the element required?
DetailsisValid(
mixed $value, mixed $context
=
null
)
:
booleanValidate element value
If a translation adapter is registered, any error messages will be translated according to the current locale, using the given error code; if no matching translation is found, the original message will be utilized.
Note: The filtered value is validated.
DetailsloadDefaultDecorators(
)
:
Zend_Form_ElementLoad default decorators
DetailsloadDefaultDecoratorsIsDisabled(
)
:
boolShould we load the default decorators?
DetailsmarkAsError(
)
:
Zend_Form_ElementMark the element as being in a failed validation state
DetailsremoveDecorator(
string $name
)
:
Zend_Form_ElementRemove a single decorator
DetailsremoveFilter(
string $name
)
:
Zend_Form_ElementRemove a filter by name
DetailsremoveValidator(
string $name
)
:
boolRemove a single validator by name
Detailsrender(
Zend_View_Interface $view
=
null
)
:
stringRender form element
DetailssetAllowEmpty(
bool $flag
)
:
Zend_Form_ElementSet 'allow empty' flag
When the allow empty flag is enabled and the required flag is false, the element will validate with empty values.
DetailssetAttrib(
string $name, mixed $value
)
:
Zend_Form_ElementSet element attribute
DetailssetAttribs(
array $attribs
)
:
Zend_Form_ElementSet multiple attributes at once
DetailssetAutoInsertNotEmptyValidator(
bool $flag
)
:
Zend_Form_ElementSet flag indicating whether a NotEmpty validator should be inserted when element is required
DetailssetBelongsTo(
string $array
)
:
Zend_Form_ElementSet array to which element belongs
DetailssetConfig(
Zend_Config $config
)
:
Zend_Form_ElementSet object state from Zend_Config object
DetailssetDecorators(
array $decorators
)
:
Zend_Form_ElementOverwrite all decorators
DetailssetDescription(
string $description
)
:
Zend_Form_ElementSet element description
DetailssetDisableLoadDefaultDecorators(
bool $flag
)
:
Zend_Form_ElementSet flag to disable loading default decorators
DetailssetDisableTranslator(
bool $flag
)
:
Zend_Form_ElementIndicate whether or not translation should be disabled
DetailssetErrorMessageSeparator(
string $separator
)
:
Zend_Form_ElementSet errorMessageSeparator
DetailssetErrorMessages(
array $messages
)
:
Zend_Form_ElementSame as addErrorMessages(), but clears custom error message stack first
DetailssetErrors(
array $messages
)
:
Zend_Form_ElementOverwrite any previously set error messages and flag as failed validation
DetailssetFilters(
array $filters
)
:
Zend_Form_ElementAdd filters to element, overwriting any already existing
DetailssetIgnore(
bool $flag
)
:
Zend_Form_ElementSet ignore flag (used when retrieving values at form level)
DetailssetIsArray(
bool $flag
)
:
Zend_Form_ElementSet flag indicating if element represents an array
DetailssetLabel(
string $label
)
:
Zend_Form_ElementSet element label
DetailssetName(
string $name
)
:
Zend_Form_ElementSet element name
DetailssetOptions(
array $options
)
:
Zend_Form_ElementSet object state from options array
DetailssetOrder(
int $order
)
:
Zend_Form_ElementSet element order
DetailssetPluginLoader(
Zend_Loader_PluginLoader_Interface $loader, string $type
)
:
Zend_Form_ElementSet plugin loader to use for validator or filter chain
DetailssetRequired(
bool $flag
=
true
)
:
Zend_Form_ElementSet required flag
DetailssetTranslator(
Zend_Translate|null $translator
=
null
)
:
Zend_Form_ElementSet translator object for localization
DetailssetValidators(
array $validators
)
:
Zend_Form_ElementSet multiple validators, overwriting previous validators
DetailssetValue(
mixed $value
)
:
Zend_Form_ElementSet element value
DetailssetView(
Zend_View_Interface $view
=
null
)
:
Zend_Form_ElementSet view object
DetailstranslatorIsDisabled(
)
:
boolIs translation disabled?
Details