Generates a control group with a file field.
@param string $name the input name.
@param string $value the input value.
@param array $htmlOptions additional HTML attributes.
@return string the generated control group.
@see self::controlGroup
968851
public static function fileFieldControlGroup($name, $value = '', $htmlOptions = array())
    {
        return self::controlGroup(self::INPUT_TYPE_FILE, $name, $value, $htmlOptions);
    }
900616
public static function searchQueryField($name, $value = '', $htmlOptions = array())
    {
        self::addCssClass('search-query', $htmlOptions);
        return self::textField($name, $value, $htmlOptions);
    }
1344655
protected function getFormGroupWithLabel($name, $value, $element)
    {
        $options = $this->getFormGroupOptions($name);

        return $this->toHtmlString('<div' . $this->html->attributes($options) . '>' . $this->label($name, $value) . $element . '</div>');
    }
1338966
public static function email($name, $value = '', array $htmlOptions = [])
    {
        return self::input('email', $name, $value) . self::htmlOptions($htmlOptions) .'>';
    }
1064667
public function toOptions($name)
    {
        $html = '';
        foreach ($this->wei->getConfig($name) as $value => $text) {
            if (is_array($text)) {
                $html .= '<optgroup label="' . $value . '">';
                foreach ($text as $v => $t) {
                    $html .= '<option value="' . $v . '">' . $t . '</option>';
                }
                $html .= '</optgroup>';
            } else {
                $html .= '<option value="' . $value . '">' . $text . '</option>';
            }
        }
        return $html;
    }
1211080
protected function renderDropDownList($name, $value, $options)
    {
        if ($this->renderer->isBootstrapTheme()) {
            Html::addCssClass($options, 'form-control');
        }

        $options['tabindex'] = self::TABINDEX;

        return Html::dropDownList($name, $value, $this->prepareItems($this->items), $options);
    }
758274
public function textarea($name, $value = null, $options = [])
    {
        $this->addErrorClass($name, $options);
        $tags['input'] = parent::textarea($name, $value, $options);
        $tags['error'] = $this->getErrorTag($name);
        return $this->buildTags($tags);
    }
663603
public static function rangeFieldControlGroup($name, $value = '', $htmlOptions = array())
    {
        return self::controlGroup(self::INPUT_TYPE_RANGE, $name, $value, $htmlOptions);
    }
821789
public function option($name, $value) {
		$this->validateName($name);
		return $this->merge([$name => $value]);
	}
636008
public function setOption($name, $value)
    {
        if (is_string($name)) {
            if (isset($this->options[$name])) {
                switch ($name) {
                    case self::OPTION_STYLE_TAG:
                        if (is_int($value)) {
                            if (!in_array($value, [
                                self::OPTION_STYLE_TAG_BODY,
                                self::OPTION_STYLE_TAG_HEAD,
                                self::OPTION_STYLE_TAG_REMOVE,
                            ])) {
                                throw new \InvalidArgumentException("Invalid value '$value' for option '$name'.");
                            }
                        } else {
                            throw new \InvalidArgumentException(
                                "Invalid type '" . gettype($value) . "' for value of option '$name'."
                            );
                        }
                        break;
                    case self::OPTION_HTML_CLASSES:
                        if (is_int($value)) {
                            if (!in_array($value, [
                                self::OPTION_HTML_CLASSES_REMOVE,
                                self::OPTION_HTML_CLASSES_KEEP,
                            ])) {
                                throw new \InvalidArgumentException("Invalid value '$value' for option '$name'.");
                            }
                        } else {
                            throw new \InvalidArgumentException(
                                "Invalid type '" . gettype($value) . "' for value of option '$name'."
                            );
                        }
                        break;
                    case self::OPTION_HTML_COMMENTS:
                        if (is_int($value)) {
                            if (!in_array($value, [
                                self::OPTION_HTML_COMMENTS_REMOVE,
                                self::OPTION_HTML_COMMENTS_KEEP,
                            ])) {
                                throw new \InvalidArgumentException("Invalid value '$value' for option '$name'.");
                            }
                        } else {
                            throw new \InvalidArgumentException(
                                "Invalid type '" . gettype($value) . "' for value of option '$name'."
                            );
                        }
                        break;
                    case self::OPTION_TEXT_LINE_WIDTH:
                        if (is_int($value)) {
                            if ($value <= 0) {
                                throw new \LengthException(
                                    "Value '" . gettype($value) . "' for option '$name' is to small."
                                );
                            }
                        } else {
                            throw new \InvalidArgumentException(
                                "Invalid type '" . gettype($value) . "' for value of option '$name'."
                            );
                        }
                        break;
                    case self::OPTION_CSS_WRITER_CLASS:
                        if (is_string($value)) {
                            if (is_subclass_of($value, '\Crossjoin\Css\Writer\WriterAbstract', true) === false) {
                                throw new \InvalidArgumentException(
                                    "Invalid value '$value' for option '$name'. " .
                                    "The given class has to be a subclass of \\Crossjoin\\Css\\Writer\\WriterAbstract."
                                );
                            }
                        } else {
                            throw new \InvalidArgumentException(
                                "Invalid type '" . gettype($value) . "' for value of option '$name'."
                            );
                        }
                }
                $this->options[$name] = $value;
            } else {
                throw new \InvalidArgumentException("An option with the name '$name' doesn't exist.");
            }
        } else {
            throw new \InvalidArgumentException("Invalid type '" . gettype($name) . "' for argument 'name'.");
        }
    }
864746
public function textarea($name, $value = null, $options = [])
    {
        return parent::textarea($name, $value, $this->appendErrors($name, $options));
    }
1166110
public function addOptionalHeader($name, $value)
    {
        Validate::isString($name, 'name');
        Validate::isString($value, 'value');

        if (!empty($value)) {
            $this->_headers[$name] = $value;
        }
    }
173121
public function label($name, $value = null, $options = [], $escape_html = true)
    {
        $this->labels[] = $name;

        $options = $this->html->attributes($options);

        $value = $this->formatLabel($name, $value);

        if ($escape_html) {
            $value = $this->html->entities($value);
        }

        return $this->toHtmlString('<label for="' . $name . '"' . $options . '>' . $value . '</label>');
    }
1309085
public function setOption($name, $value) {
		$all = [];
		for ($i = 1; $i <= $this->connection_count; $i++) {
			$connection = $this->getConnection();
			$connection->setOption($name, $value);
			$all[] = $connection;
		}
		foreach ($all as $v) {
			$this->freeConnection($v);
		}
	}
485375
public static function text($name, $value = '', array $htmlOptions = [])
    {
    	return self::input('text', $name, $value) . self::htmlOptions($htmlOptions) .'>';
    }
1300851
public function setAttribute($name, $value)
    {
        if(strlen($name) < 1)
        {
            throw new HTMLTagException("Attribute name is empty");
        }

        $this->tag_attributes[strtolower($name)] = $value;

        return $this;
    }
995665
public function setOption($name, $value)
    {
        $method = 'set' . ucfirst($name);
        if (method_exists($this, $method) && $method !== __FUNCTION__) {
            return $this->$method($value);
        }

        $this->options[$name] = $value;
        return $this;
    }