<input type="radio" name="$name" value="$value" attr="$attr" />
504372
static function radioButton($name, $selectValue, $value, $attr = array())
    {
        if ($selectValue == $value)
            $attr["checked"] = "true";

        $attr = array_merge(
            array(
                "type" => "radio",
            ),
            $attr
        );

        self::input($name, $value, $attr);
    }
1231351
public void setAttribute(String name, String value)
	{
		if (value != null)
			getElement().setAttribute(name, value);
		else
			getElement().removeAttribute(name);
	}
259684
public function radio($name, $label = null, $value = null, $checked = null, array $options = [])
    {
        $inputElement = $this->radioElement($name, $label, $value, $checked, false, $options);

        $wrapperOptions = $this->isHorizontal() ? ['class' => implode(' ', [$this->getLeftColumnOffsetClass(), $this->getRightColumnClass()])] : [];
        $wrapperElement = '<div' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . '</div>';

        return $this->getFormGroup(null, $label, $wrapperElement);
    }
888009
public static function input(
                        $type = 'text',
                        $name = '',
                        $class = '',
                        $id = NULL,
                        $value = NULL,
                        $label = NULL,
                        $attrs = array()
                        )
    {
        
        $attrs['type'] = $type;
        
        $ret = NULL;
        if($label)
            $ret .= PHP_EOL . self::formatLabel($label, $id);
        
        if($value)
            $attrs['value'] = $value;
        
        $attrs['name'] = $name;
        
        $ret .= self::tag('input', NULL, $class, $id, $attrs);
        return $ret;
    }
493193
static function textArea($name, $value, $attr = array())
    {
        $html = "<textarea ";

        $attr = array_merge(
            array(
                "name" => $name
            ),
            $attr
        );

        $html .= self::getAttributes($attr);
        $html .= ">" . $value . '</textarea>';

        echo $html;
    }
592283
function(el, attrName, val) {
                    var oldValue;
                    // In order to later trigger an event we need to compare the new value to the old value, so here we go ahead and retrieve the old value for browsers that don't have native MutationObservers.
                    if (!attr.MutationObserver) {
                        oldValue = attr.get(el, attrName);
                    }

                    var tagName = el.nodeName.toString()
                        .toLowerCase(),
                        prop = attr.map[attrName],
                        newValue;

                    // Using the property of `attr.map`, go through and check if the property is a function, and if so call it. Then check if the property is `true`, and if so set the value to `true`, also making sure to set `defaultChecked` to `true` for elements of `attr.defaultValue`. We always set the value to true because for these boolean properties, setting them to false would be the same as removing the attribute.
                    // For all other attributes use `setAttribute` to set the new value.
                    if (typeof prop === "function") {
                        newValue = prop(el, val);
                    } else if (prop === true) {
                        newValue = el[attrName] = true;

                        if (attrName === "checked" && el.type === "radio") {
                            if (can.inArray(tagName, attr.defaultValue) >= 0) {
                                el.defaultChecked = true;
                            }
                        }

                    } else if (prop) {
                        newValue = el[prop] = val;
                        if (prop === "value" && can.inArray(tagName, attr.defaultValue) >= 0) {
                            el.defaultValue = val;
                        }
                    } else {
                        el.setAttribute(attrName, val);
                        newValue = val;
                    }

                    // Now that the value has been set, for browsers without MutationObservers, check to see that value has changed and if so trigger the "attributes" event on the element.
                    if (!attr.MutationObserver && newValue !== oldValue) {
                        attr.trigger(el, attrName, oldValue);
                    }
                }
1131118
static function input_attr(&$attr)
	{
	    $str = " ";
        if(!empty($attr) && is_array($attr))
        {
            foreach($attr as $key=>$value)
            {
                $str .= "$key=\"$value\" ";
            }
        }
        return $str;
	}
626546
function setAttributeValues(dom) {
  // List of input types here https://www.w3.org/TR/html5/forms.html#the-input-element

  // Limit scope to inputs only as textareas do not retain their value when cloned
  let elems = dom.find(
    `input[type=text], input[type=search], input[type=tel], input[type=url], input[type=email],
     input[type=password], input[type=number], input[type=checkbox], input[type=radio]`
  );

  percyJQuery(elems).each(function() {
    let elem = percyJQuery(this);
    switch(elem.attr('type')) {
      case 'checkbox':
      case 'radio':
        if (elem.is(':checked')) {
          elem.attr('checked', '');
        }
        break;
      default:
        elem.attr('value', elem.val());
    }
  });

  return dom;
}
10721
public function radioElement($name, $label = null, $value = null, $checked = null, $inline = false, array $options = [])
    {
        $label = $label === false ? null : $this->getLabelTitle($label, $name);

        $value = is_null($value) ? $label : $value;

        $labelOptions = $inline ? ['class' => 'radio-inline'] : [];

        $inputElement = $this->form->radio($name, $value, $checked, $options);
        $labelElement = '<label ' . $this->html->attributes($labelOptions) . '>' . $inputElement . $label . '</label>';

        return $inline ? $labelElement : '<div class="radio">' . $labelElement . '</div>';
    }
324108
function attr(name, value) {
    var self = this;
    if (arguments.length === 0) {
      return self._attrs;
    }
    if (Util.isObject(name)) {
      // self._attrs = Util.deepMix(self._attrs, name);
      for (var k in name) {
        this._setAttr(k, name[k]);
      }
      self.clearBBox();
      this._cfg.hasUpdate = true;
      return self;
    }
    if (arguments.length === 2) {
      this._setAttr(name, value);
      self.clearBBox();
      this._cfg.hasUpdate = true;
      return self;
    }
    return self._attrs[name];
  }
29187
def set_input_value(self, selector, value):
        """"""
        script = 'document.querySelector("%s").setAttribute("value", "%s")'
        script = script % (selector, value)
        self.evaluate(script)
1258510
function(element, name, value) {
		var spirit = element.spirit;
		if (spirit) {
			spirit.att.set(name, value);
		} else {
			element.setAttribute(name, value);
			switch (name) {
				case "checked":
					if (!element.checked) {
						element.checked = true;
					}
					break;
				case "value":
					if (element.value !== value) {
						element.value = String(value); // ?
					}
					break;
			}
		}
	}
86738
public function def($attr, $value)
    {
        $this->attributes[$attr] = isset($this->attributes[$attr]) ? $this->attributes[$attr] : (string) $value;
    }
1135465
static function input($input_type, $name, $value=null, $settings=[])
    {
        $settings = static::formatSettings($settings);
        is_array($value) && $value = current($value);
        $str = '';
        $pre_input_type = $input_type;
        switch ($input_type) {
            case 'checkbox':
            case 'radio':
                $settings['class'] = isset($settings['class']) ? $settings['class'] : 'ace ace-switch ace-switch-5';
                $str .= '<label>' . PHP_EOL ;
                break;
            case 'text':
            case 'password':
                $settings['id'] = isset($settings['id']) ? static::formatId($settings['id']) : static::formatId($name);
                $settings['class'] = isset($settings['class']) ? 'form-control ' . $settings['class'] : 'form-control';
                break;
            case 'datetime':
            case 'date':
                $input_type = 'text';
                $value = $pre_input_type == 'datetime' ? DataHelper::fromUnixtime($value) : DataHelper::toDate($value);
                $settings['id'] = isset($settings['id']) ? static::formatId($settings['id']) : static::formatId($name);
                $settings['class']  = isset($settings['class']) ? $settings['class'] . ' form-control date-picker' : ' form-control date-picker';
                break;
            default:
                $settings['class'] = isset($settings['class']) ? $settings['class'] : '';
                break;
        }
        
        $str .= '<input type="' . $input_type . '" name="' . $name . '"';
        
        if ($input_type == 'checkbox' || $input_type == 'radio') {
            // 处理 value, checked
            $o_form_value = !is_null($value) || $value !== '' ? $value : '1';
            $value   = $value ? : '1';
            if (isset($settings['checked'])) {
                if (is_array($settings['checked'])) {
                    $_checked = in_array($value, $settings['checked']) ? true : false;
                } elseif (in_array($settings['checked'], ['', 1,0,true,false])) {
                    $_checked = $settings['checked'];
                } else {
                    $_checked = $value == $settings['checked'] ? true : false;
                }
                $str .= $_checked ? ' checked="checked"' : '';
            } elseif (is_numeric($o_form_value) || is_bool($o_form_value)) {
                if (intval($o_form_value) == 1) {
                    $str .= ' checked="checked"';
                }
            }
        }
        
        $str .= ' value="' . $value . '"';
        
        foreach($settings as $k => $v) {
            if (in_array($k, array('class', 'onchange', 'id', 'readonly', 'style', 'placeholder'))) {
                $str .= " $k=\"$v\"";
            } elseif($k == 'checked' && ($input_type !== 'checkbox' && $input_type !== 'radio')) {
                $str .= " $k=\"$v\"";
            }
        }
        $str .= '> ';
        
        if ($input_type == 'checkbox' || $input_type == 'radio') {
            $title = isset($settings['title']) ? $settings['title'] : '';
            $str .= ' <span class="lbl"> '.$title.' </span> ' . PHP_EOL;
            $str .= '</label>' . PHP_EOL ;
        }
        
        /**
         * 处理日期输入控件，依赖于 jquery.js, jquery-ui.datetime.js, datetimepicker.js, datetimepicker.css
         * <script src='{$rootUrl}/static/jquery/jquery-1.10.2.min.js'></script>
         * <link type="text/css" rel="stylesheet" href="{$rootUrl}/static/datetimepicker-2.5.3/jquery.datetimepicker.css"/>
         * <script src="{$rootUrl}/static/datetimepicker-2.5.3/jquery.datetimepicker.full.min.js"></script>
         */
        if ($pre_input_type == 'datetime' || $pre_input_type == 'date') {
            $innerJs = "";
            $dformat = $pre_input_type == 'datetime' ? 'Y-m-d H:i:s' : 'Y-m-d';
            if (!static::$isLoaded['datetime']) {
                $web_url = Config::getRootUrl();
                $innerJs .= <<<EOF
                    <link type="text/css" rel="stylesheet" href="${web_url}/static/datetimepicker-2.5.3/jquery.datetimepicker.css"/>
EOF;
                static::$isLoaded['datetime'] = true;
            }
            $innerJs .= <<<EOF
                <script>
                    require(['jquery.datetime'], function() {
                        $("#${settings['id']}").datetimepicker({
                    		format:	"{$dformat}",
                    	});
                    });
                </script>
EOF;
            $dt_str = '<div class="input-group input-group-sm">' . PHP_EOL;
            $dt_str .= $str . PHP_EOL;
            $dt_str .= '<span class="input-group-addon">' . PHP_EOL;
            $dt_str .= '    <i class="fa fa-clock-o bigger-110"></i>' . PHP_EOL;
            $dt_str .= '</span>' . PHP_EOL;
            $dt_str .= '</div>' . PHP_EOL;
            $dt_str .= $innerJs;
            	
            $str = & $dt_str;
        }
         
        return $str;
    }
162712
@Override
    public void setValue(String value, boolean fireEvents) {
        String oldValue = fireEvents ? getValue() : null;
        boolean changed = false;
        for (JQMRadio r : radios) { // first we have to uncheck already checked radios (UI refresh issue)
            TextBox radio = r.getInput();
            if (!isChecked(radio)) continue;
            boolean checked = value != null && value.equals(radio.getValue()) ? true : false;
            if (!checked) {
                setChecked(radio, false);
                changed = true;
            }
        }
        for (JQMRadio r : radios) {
            TextBox radio = r.getInput();
            boolean checked = value != null && value.equals(radio.getValue()) ? true : false;
            if (isChecked(radio) != checked) {
                setChecked(radio, checked);
                changed = true;
            }
        }
        if (fireEvents && changed) {
            String newValue = getValue();
            boolean eq = newValue == oldValue || newValue != null && newValue.equals(oldValue);
            if (!eq) {
                SelectionEvent.fire(this, newValue);
                ValueChangeEvent.fire(this, newValue);
            }
        }
    }
356382
function set_cell_attribute($name,$attr,$value){
		if (!array_key_exists($name, $this->cell_attrs)) $this->cell_attrs[$name]=array();
		$this->cell_attrs[$name][$attr]=$value;
	}
847025
public function input($type, $name, $value = null, array $attributes = [])
    {
        $tag = new Tag('input', $attributes);
        $tag->type = $type;
        $tag->name = $name;
        $tag->value = $value;
        return $tag;
    }