I'm looking for a simple solution for a "checked" state for the Yii2 ActiveForm checkbox control and I can't find a solution how to set it. I cant find any examples in the documentation.
I've tried to manipulate the rendering code
<?php
echo $form->field($model, 'permissions[clients][view_all]')
->checkbox([
'uncheck'=>false,
'labelOptions' => [
'style' => 'padding-left:20px;'
]
])->label('View all');
?>
So how set activeChechbox to checked?
Aucun commentaire:
Enregistrer un commentaire