Form/Element/Checkbox.php

Show: PublicProtectedPrivateinherited
Table of Contents
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 [email protected] 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  
Subpackage
Element  

\Zend_Form_Element_Checkbox

Package: Zend_Form\Element
Checkbox form element
Parent(s)
\Zend_Form_Element_Xhtml < \Zend_Form_Element
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Version
$Id$  

Properties

>VPropertyprotectedstring $_checkedValue = '1'
Value when checked
Default value'1'Details
Type
string
>VPropertyprotectedstring $_uncheckedValue = '0'
Value when not checked
Default value'0'Details
Type
string
>VPropertyprotectedstring $_value = '0'
Current value
Default value'0'Details
Type
string
>VPropertypublicbool $checked = false
Is the checkbox checked?
Default valuefalseDetails
Type
bool
>VPropertypublicstring $helper = 'formCheckbox'
Use formCheckbox view helper by default
Default value'formCheckbox'Details
Type
string
>VPropertypublicarray $options = array('checkedValue' => '1', 'uncheckedValue' => '0')
Options that will be passed to the view helper
Default valuearray('checkedValue' => '1', 'uncheckedValue' => '0')Details
Type
array

Methods

methodpublicgetCheckedValue() : string

Get value when checked

Returns
TypeDescription
string
methodpublicgetUncheckedValue() : string

Get value when not checked

Returns
TypeDescription
string
methodpublicisChecked() : bool

Get checked flag

Returns
TypeDescription
bool
methodpublicsetChecked(bool $flag) : \Zend_Form_Element_Checkbox

Set checked flag

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element_Checkbox
methodpublicsetCheckedValue(string $value) : \Zend_Form_Element_Checkbox

Set checked value

Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
\Zend_Form_Element_Checkbox
methodpublicsetOptions(array $options) : \Zend_Form_Element_Checkbox

Set options

Intercept checked and unchecked values and set them early; test stored value against checked and unchecked values after configuration.
Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Form_Element_Checkbox
methodpublicsetUncheckedValue(string $value) : \Zend_Form_Element_Checkbox

Set unchecked value

Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
\Zend_Form_Element_Checkbox
methodpublicsetValue(mixed $value) : \Zend_Form_Element_Checkbox

Set value

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.
Parameters
NameTypeDescription
$valuemixed
Returns
TypeDescription
\Zend_Form_Element_Checkbox
Documentation was generated by phpDocumentor 2.2.0 .