Source for file radio.php
Documentation is available at radio.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* HTML class for a radio type element
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2011 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: radio.php 317587 2011-10-01 07:55:53Z avb $
* @link http://pear.php.net/package/HTML_QuickForm
* Base class for <input /> form elements
require_once 'HTML/QuickForm/input.php';
* HTML class for a radio type element
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.13
* @param string Input field name attribute
* @param mixed Label(s) for a field
* @param string Text to display near the radio
* @param string Input field value
* @param mixed Either a typical HTML attribute string or an associative array
function HTML_QuickForm_radio($elementName=null , $elementLabel=null , $text=null , $value=null , $attributes=null )
$this->_persistantFreeze = true;
* Sets whether radio button is checked
* @param bool $checked Whether the field is checked or not
$this->removeAttribute ('checked');
$this->updateAttributes (array ('checked'=> 'checked'));
* Returns whether radio button is checked
return $this->getAttribute ('checked');
* Returns the radio element in HTML
if (0 == strlen($this->_text)) {
} elseif ($this->_flagFrozen) {
$label = '<label for="' . $this->getAttribute ('id') . '">' . $this->_text . '</label>';
* Returns the value of field without HTML tags
$this->_getPersistantData ();
} //end func getFrozenHtml
* @param string $text Text to display near the radio button
// {{{ onQuickFormEvent()
* Called by HTML_QuickForm whenever form event is made on this element
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object &$caller calling object
// constant values override both default and submitted ones
// default values are overriden by submitted
$value = $this->_findValue ($caller->_constantValues );
$value = $this->_findValue ($caller->_submitValues );
$value = $this->_findValue ($caller->_defaultValues );
} // end func onQuickFormLoad
* Returns the value attribute if the radio is checked, null if it is not
$value = $this->_findValue ($submitValues);
} elseif ($value != $this->getValue()) {
return $this->_prepareValue ($value, $assoc);
} //end class HTML_QuickForm_radio
Documentation generated on Sat, 01 Oct 2011 09:00:18 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.
|