checked = $value === 'true';
}
public function render(): string
{
unset($this->attributes['checked']);
$wrapperClass = $this->class;
unset($this->attributes['class']);
$sizeClass = [
'base' => 'form-switch-slider',
'small' => 'form-switch-slider form-switch-slider--small',
];
$this->attributes['class'] = 'form-switch';
$checkbox = form_checkbox($this->attributes, $this->value, old($this->name, $this->checked));
$hint = $this->hint === '' ? '' : hint_tooltip($this->hint, 'ml-1');
return <<
{$checkbox}
{$this->slot}{$hint}
HTML;
}
}