Skip to content

Instantly share code, notes, and snippets.

@keithslater
Last active February 24, 2017 22:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save keithslater/a022b98c840e3be63ddb34fbbf2009c0 to your computer and use it in GitHub Desktop.
Yii2 Toggle checkbox
<?php echo $form->field($model->notifications, "status", ['checkboxTemplate' => '
<span class="label">{label}</span>
<label class="toggle-inner">
{input}
<div class="toggle-background"></div>
<div class="toggle-button"></div>
</label>
','options' => [
'tag' => null,
],])->checkbox()->label($notification->type->name); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment