Checkbox form element
category | Zend |
---|---|
package | Zend_Form |
subpackage | Element |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
version | $Id$ |
inherited_from | \Zend_Form_Element_Xhtml |
__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
__construct(string|array|\Zend_Config $spec, array|\Zend_Config $options = null
) : void
$spec may be:
string
array
\Zend_Config
array
\Zend_Config
\Zend_Form_Exception |
if no element name after initialization |
---|
__get(string $key) : mixed
Prevents access to properties beginning with '_'.
string
mixed
__set(string $key, mixed $value) : \voide
string
mixed
\voide
__toString() : string
Proxies to \render().
string
addDecorator(string|\Zend_Form_Decorator_Interface $decorator, array|\Zend_Config $options = null
) : \Zend_Form_Element
string
\Zend_Form_Decorator_Interface
array
\Zend_Config
Options with which to initialize decorator
\Zend_Form_Element
addDecorators(array $decorators) : \Zend_Form_Element
array
\Zend_Form_Element
addError(string $message) : \Zend_Form_Element
string
\Zend_Form_Element
addErrorMessage(string $message) : \Zend_Form_Element
string
\Zend_Form_Element
addErrorMessages(array $messages) : \Zend_Form_Element
array
\Zend_Form_Element
addErrors(array $messages) : \Zend_Form_Element
array
\Zend_Form_Element
addFilter(string|\Zend_Filter_Interface $filter, $options = array()
) : \Zend_Form_Element
string
\Zend_Filter_Interface
\Zend_Form_Element
addFilters(array $filters) : \Zend_Form_Element
array
\Zend_Form_Element
addPrefixPath(string $prefix, string $path, string $type = null
) : \Zend_Form_Element
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.
string
string
string
\Zend_Form_Exception |
for invalid type |
---|
\Zend_Form_Element
addPrefixPaths(array $spec) : \Zend_Form_Element
array
\Zend_Form_Element
addValidator(string|\Zend_Validate_Interface $validator, boolean $breakChainOnFailure= false
, array $options= array()
) : \Zend_Form_Element
Note: will overwrite existing validators if they are of the same class.
string
\Zend_Validate_Interface
boolean
array
\Zend_Form_Exception |
if invalid validator type |
---|
\Zend_Form_Element
addValidators(array $validators) : \Zend_Form_Element
array
\Zend_Form_Element
autoInsertNotEmptyValidator() : boolean
boolean
clearDecorators() : \Zend_Form_Element
\Zend_Form_Element
clearErrorMessages() : \Zend_Form_Element
\Zend_Form_Element
clearFilters() : \Zend_Form_Element
\Zend_Form_Element
clearValidators() : \Zend_Form_Element
\Zend_Form_Element
filterName(string $value, boolean $allowBrackets = false
) : string
string
boolean
string
getAllowEmpty() : boolean
boolean
getAttrib(string $name) : string
string
string
getAttribs() : array
array
getBelongsTo() : string
string
getCheckedValue() : string
string
getConcatJustValuesInErrorMessage() : boolean
boolean
getDecorator(string $name) : false | \Zend_Form_Decorator_Abstract
string
false
\Zend_Form_Decorator_Abstract
getDecorators() : array
array
getDescription() : string
string
getErrorMessageSeparator() : string
string
getErrorMessages() : array
array
getErrors() : array
array
getFilter(string $name) : \Zend_Filter_Interface
string
\Zend_Filter_Interface
getFilters() : array
array
getFullyQualifiedName() : string
Places name as subitem of array and/or appends brackets.
string
getId() : string
string
getIgnore() : boolean
boolean
getLabel() : string
string
getMessages() : 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() |
---|
array
getName() : string
string
getOrder() : integer
integer
getPluginLoader(string $type) : \Zend_Loader_PluginLoader
Instantiates with default rules if none available for that type. Use 'decorator', 'filter', or 'validate' for $type.
string
\Zend_Loader_Exception |
on invalid type. |
---|
\Zend_Loader_PluginLoader
getTranslator() : \Zend_Translate_Adapter | null
\Zend_Translate_Adapter
null
getType() : string
string
getUncheckedValue() : string
string
getUnfilteredValue() : mixed
mixed
getValidator(string $name) : \Zend_Validate_Interface | false
string
\Zend_Validate_Interface
false
False if not found, validator otherwisegetValidators() : array
array
getValue() : mixed
mixed
getView() : null | \Zend_View_Interface
Retrieves from ViewRenderer if none previously set.
null
\Zend_View_Interface
hasErrors() : boolean
boolean
hasTranslator() : boolean
boolean
init() : void
isArray() : boolean
boolean
isChecked() : boolean
boolean
isRequired() : boolean
boolean
isValid(mixed $value, mixed $context = null
) : boolean
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.
inherited_from | \Zend_Validate_Interface::isValid() |
---|
mixed
mixed
boolean
loadDefaultDecorators() : \Zend_Form_Element
\Zend_Form_Element
loadDefaultDecoratorsIsDisabled() : boolean
boolean
markAsError() : \Zend_Form_Element
\Zend_Form_Element
removeDecorator(string $name) : \Zend_Form_Element
string
\Zend_Form_Element
removeFilter(string $name) : \Zend_Form_Element
string
\Zend_Form_Element
removeValidator(string $name) : boolean
string
boolean
render(\Zend_View_Interface $view = null
) : string
\Zend_View_Interface
string
resolveElementId(\Zend_Form_Decorator_Interface $decorator) : string
Passed to the HtmlTag decorator as a callback in order to provide an ID.
\Zend_Form_Decorator_Interface
string
setAllowEmpty(boolean $flag) : \Zend_Form_Element
When the allow empty flag is enabled and the required flag is false, the element will validate with empty values.
boolean
\Zend_Form_Element
setAttrib(string $name, mixed $value) : \Zend_Form_Element
string
mixed
\Zend_Form_Exception |
for invalid $name values |
---|
\Zend_Form_Element
setAttribs(array $attribs) : \Zend_Form_Element
array
\Zend_Form_Element
setAutoInsertNotEmptyValidator(boolean $flag) : \Zend_Form_Element
boolean
\Zend_Form_Element
setBelongsTo(string $array) : \Zend_Form_Element
string
\Zend_Form_Element
setChecked(boolean $flag) : \Zend_Form_Element_Checkbox
boolean
\Zend_Form_Element_Checkbox
setCheckedValue(string $value) : \Zend_Form_Element_Checkbox
string
\Zend_Form_Element_Checkbox
setConcatJustValuesInErrorMessage(boolean $concatJustValuesInErrorMessage) : \Zend_Form_Element
boolean
\Zend_Form_Element
setConfig(\Zend_Config $config) : \Zend_Form_Element
\Zend_Config
\Zend_Form_Element
setDecorators(array $decorators) : \Zend_Form_Element
array
\Zend_Form_Element
setDescription(string $description) : \Zend_Form_Element
string
\Zend_Form_Element
setDisableLoadDefaultDecorators(boolean $flag) : \Zend_Form_Element
boolean
\Zend_Form_Element
setDisableTranslator(boolean $flag) : \Zend_Form_Element
boolean
\Zend_Form_Element
setErrorMessageSeparator(string $separator) : \Zend_Form_Element
string
\Zend_Form_Element
setErrorMessages(array $messages) : \Zend_Form_Element
array
\Zend_Form_Element
setErrors(array $messages) : \Zend_Form_Element
array
\Zend_Form_Element
setFilters(array $filters) : \Zend_Form_Element
array
\Zend_Form_Element
setIgnore(boolean $flag) : \Zend_Form_Element
boolean
\Zend_Form_Element
setIsArray(boolean $flag) : \Zend_Form_Element
boolean
\Zend_Form_Element
setLabel(string $label) : \Zend_Form_Element
string
\Zend_Form_Element
setName(string $name) : \Zend_Form_Element
string
\Zend_Form_Element
setOptions(array $options) : \Zend_Form_Element_Checkbox
Intercept checked and unchecked values and set them early; test stored value against checked and unchecked values after configuration.
array
\Zend_Form_Element_Checkbox
setOptions(array $options) : \Zend_Form_Element
array
\Zend_Form_Element
setOrder(integer $order) : \Zend_Form_Element
integer
\Zend_Form_Element
setPluginLoader(\Zend_Loader_PluginLoader_Interface $loader, string $type) : \Zend_Form_Element
\Zend_Loader_PluginLoader_Interface
string
'decorator', 'filter', or 'validate'
\Zend_Form_Exception |
on invalid type |
---|
\Zend_Form_Element
setRequired(boolean $flag = true
) : \Zend_Form_Element
boolean
Default value is true
\Zend_Form_Element
setTranslator(\Zend_Translate|null $translator = null
) : \Zend_Form_Element
\Zend_Translate
null
\Zend_Form_Element
setUncheckedValue(string $value) : \Zend_Form_Element_Checkbox
string
\Zend_Form_Element_Checkbox
setValidators(array $validators) : \Zend_Form_Element
array
\Zend_Form_Element
setValue(mixed $value) : \Zend_Form_Element_Checkbox
If value matches checked value, sets to that value, and sets the checked flag to true.
Any other value causes the unchecked value to be set as the current value, and the checked flag to be set as false.
mixed
\Zend_Form_Element_Checkbox
setValue(mixed $value) : \Zend_Form_Element
mixed
\Zend_Form_Element
setView(\Zend_View_Interface $view = null
) : \Zend_Form_Element
\Zend_View_Interface
\Zend_Form_Element
translatorIsDisabled() : boolean
boolean
_filterValue(string $value, string $key) : void
string
string
_getDecorator(string $name, null|array $options) : \Zend_Form_Decorator_Interface
string
null
array
\Zend_Form_Decorator_Interface
_getErrorMessages() : array
array
_hasErrorMessages() : boolean
boolean
_loadDecorator(array $decorator, mixed $name) : \Zend_Form_Decorator_Interface
array
Decorator type and options
mixed
Decorator name or alias
\Zend_Form_Decorator_Interface
_loadFilter(array $filter) : \Zend_Filter_Interface
array
\Zend_Filter_Interface
_loadValidator(array $validator) : \Zend_Validate_Interface
array
Validator definition
\Zend_Validate_Interface
$checked : boolean
false
$helper : string
'formCheckbox'
$helper : string
'formText'
$_allowEmpty : boolean
true
$_autoInsertNotEmptyValidator : boolean
true
$_belongsTo : string
$_checkedValue : string
'1'
$_concatJustValuesInErrorMessage : boolean
false
$_decorators : array
array()
$_description : string
$_disableLoadDefaultDecorators : boolean
false
$_errorMessageSeparator : string
'; '
$_errorMessages : array
array()
$_errors : array
array()
$_filters : array
array()
$_ignore : boolean
false
$_isArray : boolean
false
$_isError : boolean
false
$_isErrorForced : boolean
false
$_isPartialRendering : boolean
false
This is to allow execution of logic inside the render() methods of child elements during the magic call while skipping the parent render() method.
$_label : string
$_loaders : array
array()
$_name : string
$_order : integer
$_required : boolean
false
$_translator : \Zend_Translate
$_translatorDisabled : boolean
false
$_type : string
$_uncheckedValue : string
'0'
$_validatorRules : array
array()
$_validators : array
array()
$_value : string
'0'
$_value : mixed
$_view : \Zend_View_Interface
DECORATOR = 'DECORATOR'
FILTER = 'FILTER'
VALIDATE = 'VALIDATE'