How to Make Checkbox selected in Default.? what is the syntax for this.
THis is my code
<?= $form->field($model, 'attendence')->checkbox(['checked'=>true])->label(false) ?>
help me out
and then it is not checked inside the loop.
How to Make Checkbox selected in Default.? what is the syntax for this.
THis is my code
<?= $form->field($model, 'attendence')->checkbox(['checked'=>true])->label(false) ?>
help me out
and then it is not checked inside the loop.
Set the default value to the model.
$model->attendence = true;
What do you mean by that?
Setting the attribute to true should automatically check the checkbox.