API Documentation

Zend/Form/Element/Checkbox.php

Show: inherited
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 license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Version
$Id: Checkbox.php 24594 2012-01-05 21:27:01Z matthew $  

Properties

Propertyprotectedstring  $_checkedValue= ''1''

Value when checked

Default value'1'Details
Type
string
Propertyprotectedstring  $_uncheckedValue= ''0''

Value when not checked

Default value'0'Details
Type
string
Propertyprotectedstring  $_value= ''0''

Current value

0 or 1
Default value'0'Details
Type
string
Propertypublicbool  $checked= 'false'

Is the checkbox checked?

Default valuefalseDetails
Type
bool
Propertypublicstring  $helper= ''formCheckbox''

Use formCheckbox view helper by default

Default value'formCheckbox'Details
Type
string
Propertypublicarray  $options= 'array( 'checkedValue' => '1''

Options that will be passed to the view helper

Default valuearray( 'checkedValue' => '1'Details
Type
array

Methods

methodpublicgetCheckedValue( ) : string

Get value when checked

Returns
Type Description
string
methodpublicgetUncheckedValue( ) : string

Get value when not checked

Returns
Type Description
string
methodpublicisChecked( ) : bool

Get checked flag

Returns
Type Description
bool
methodpublicsetChecked( bool $flag ) : \Zend_Form_Element_Checkbox

Set checked flag

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Form_Element_Checkbox
methodpublicsetCheckedValue( string $value ) : \Zend_Form_Element_Checkbox

Set checked value

Parameters
Name Type Description
$value string
Returns
Type Description
\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
Name Type Description
$options array
Returns
Type Description
\Zend_Form_Element_Checkbox
methodpublicsetUncheckedValue( string $value ) : \Zend_Form_Element_Checkbox

Set unchecked value

Parameters
Name Type Description
$value string
Returns
Type Description
\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
Name Type Description
$value mixed
Returns
Type Description
\Zend_Form_Element_Checkbox
Documentation was generated by DocBlox 0.15.1.