选择语言 :

 Core_Form::checkbox

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 ] )
uses
Form::input

参数列表

参数 类型 描述 默认值
$name string Input name
$value string Input value null
$checked boolean Checked status bool false
$attributes array Html attributes null
返回值
  • string
File: ./core/classes/form.class.php
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);
}