Creates a checkbox form input.
echo Form::checkbox('remember_me', 1, (bool) $remember);
string Core_Form::checkbox( string $name [, string $value = null , boolean $checked = bool false , array $attributes = null ] )
参数列表
参数 类型 描述 默认值 $namestringInput name $valuestringInput value null $checkedbooleanChecked status bool false $attributesarrayHtml attributes null
string public static function checkbox($name, $value = null, $checked = false, array $attributes = null)
{
$attributes['type'] = 'checkbox';
if (true===$checked)
{
// Make the checkbox active
$attributes['checked'] = 'checked';
}
return Form::input($name, $value, $attributes);
}