Yii2 - Display checkbox from database boolean field with switchery plugin

yii2
voted: 1
vote
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']) ?>
</div>
working url: not entered
version: 2 and maybe others
Leave a Comment:
Characters left:
No comments yet.