When use code
<?=
$form->field(
$model,
'is_registered',
['template' => '{input}{label}{error}']
)->checkbox()->label()
?>
it render HTML like
<label>
<input id="my-input" type="checkbox">
My label
<label>
<label for="my-input">My Label</label>
instead
<input id="my-input" type="checkbox">
<label for="my-input">My Label</label>
You should use ->checkbox([], false) or ->checkbox(['label' => null]).
I used
->checkbox([], false)
and it doesn't work, but
->checkbox(['label' => null])
works fine. I thank that $enclosedByLabel = false is disabling enclose by label
Just checked in a fix. Both should work fine now. Thanks.
Works perfect. Thanks!
Most helpful comment
You should use
->checkbox([], false)or->checkbox(['label' => null]).