<?= $form->field($formFilter, 'category', [
'options' => [
'tag' => 'fieldset',
'class' => 'search-task__categories'
]
])->checkboxList(Category::getCategorisList(), [
'tag' => false,
'item' => function ($index, $label, $name, $checked, $value) {
return '<label class="checkbox__legend">' .
Html::checkbox($name, $checked, [
'class' => 'visually-hidden checkbox__input',
'value' => $value
]) . '<span>' . $label . '</span>
</label>';
}
]); ?>
->label(false)
->checkboxList($items, ['unselect'=>false])
public function label($label = null, $options = [])
чтоб она рендерила legend и указать этот новый класс в форме. <?= $form->field($formFilter, 'category', [
"template" => Html::tag('legend',"{labelTitle}") . "\n{input}",
'options' => [
'tag' => 'fieldset',
'class' => 'search-task__categories',
]
])->checkboxList(Category::getCategorisList(), [
'unselect' => null,
'tag' => false,
'item' => function ($index, $label, $name, $checked, $value) {
return Html::beginTag('label',['class' =>'checkbox__legend']) .
Html::checkbox($name, $checked, [
'class' => 'visually-hidden checkbox__input',
'value' => $value
]) . Html::tag('span',$label) . Html::endTag('label');
}
]); ?>