本文整理匯總了PHP中SimpleWidget類的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleWidget類的具體用法?PHP SimpleWidget怎麽用?PHP SimpleWidget使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了SimpleWidget類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setWidget
/**
* Sets the widget into the form, grouping radio
* buttons if any.
* @param SimpleWidget $tag Incoming form control.
* @access private
*/
protected function setWidget($tag)
{
if (strtolower($tag->getAttribute('type')) == 'radio') {
$this->addRadioButton($tag);
} elseif (strtolower($tag->getAttribute('type')) == 'checkbox') {
$this->addCheckbox($tag);
} else {
$this->widgets[] =& $tag;
}
}
示例2: isMatch
/**
* Comparison. Compares id attribute of widget.
* @param SimpleWidget $widget Control to compare.
* @access public
*/
function isMatch($widget)
{
return $widget->isId($this->_id);
}
示例3: elseif
/**
* Sets the widget into the form, grouping radio
* buttons if any.
* @param SimpleWidget $tag Incoming form control.
* @access private
*/
function _setWidget($tag) {
if (strtolower($tag->getAttribute('type')) == 'radio') {
$this->_addRadioButton($tag);
} elseif (strtolower($tag->getAttribute('type')) == 'checkbox') {
$this->_addCheckbox($tag);
} else {
$this->_widgets[$tag->getName()] = &$tag;
}
}
示例4: elseif
/**
* Sets the widget into the form, grouping radio
* buttons if any.
* @param SimpleWidget $tag Incoming form control.
* @access private
*/
function _setWidget($tag)
{
if (strtolower($tag->getAttribute("type")) == "radio") {
$this->_addRadioButton($tag);
} elseif (strtolower($tag->getAttribute("type")) == "checkbox") {
$this->_addCheckbox($tag);
} else {
$this->_widgets[$tag->getName()] =& $tag;
}
}
示例5: setValue
/**
* The only allowed value in the one in the
* "value" attribute. The default for this
* attribute is "on". If this widget is set to
* true, then the usual value will be taken.
* @param string $value New value.
* @return boolean True if allowed.
* @access public
*/
function setValue($value)
{
if ($value === false) {
return parent::setValue($value);
}
if ($value === true) {
return parent::setValue($this->getAttribute('value'));
}
if ($value != $this->getAttribute('value')) {
return false;
}
return parent::setValue($value);
}