protected static function activeBooleanInput($type, $model, $attribute, $options = [])
{
$name = isset($options['name']) ? $options['name'] : static::getInputName($model, $attribute);
$value = static::getAttributeValue($model, $attribute);
if (!array_key_exists('value', $options)) {
$options['value'] = '1';
}
if (!array_key_exists('uncheck', $options)) {
$options['uncheck'] = '0';
}
if (!array_key_exists('label', $options)) {
$options['label'] = static::encode($model->getAttributeLabel(static::getAttributeName($attribute)));
}
$checked = "{$value}" === "{$options['value']}";
if (!array_key_exists('id', $options)) {
$options['id'] = static::getInputId($model, $attribute);
}
return static::$type($name, $checked, $options);
}