Yii2 - Display checkbox from database boolean field with switchery plugin

voted: 1
yii2 checkbox active-form

When switchery plugin is implemented correctly all what is needed is:

<div class="switch-wrapper switch-enable" data-switch="enable">
        <?php echo $form->field($model, 'active')->checkBox(['label' => 'active', 'selected' => $model->active, 'class' => $model->active == true ? 'switch off' : 'switch']) ?>
working url: not entered
version: 2 and maybe others
Leave a Comment:
Characters left:
No comments yet.