* Add autocomplete to front class.

This commit is contained in:
Yagami
2019-02-20 14:27:38 +08:00
parent 75c0f11b4f
commit b5987e61a1
+20
View File
@@ -39,6 +39,26 @@ class html extends baseHTML
return parent::a($href, $title, $misc, $newline);
}
/**
* 生成input输入标签。
* Create tags like "<input type='text' />"
*
* @param string $name the name of the text input tag.
* @param string $value the default value.
* @param string $attrib other attribs.
* @static
* @access public
* @return string
*/
static public function input($name, $value = "", $attrib = "", $autocomplete = false)
{
$id = "id='$name'";
if(strpos($attrib, 'id=') !== false) $id = '';
$value = str_replace("'", '&#039;', $value);
$autocomplete = $autocomplete ? 'autocomplete="on"' : 'autocomplete="off"';
return "<input type='text' name='$name' {$id} value='$value' $attrib $autocomplete />\n";
}
/**
* 生成多选按钮。
* Create tags like "<input type='checkbox' />"