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 ] )
参数列表
参数 类型 描述 默认值 $name
string
Input name $value
string
Input value null $checked
boolean
Checked status bool false $attributes
array
Html 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);
}