Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 866 Bytes

README.md

File metadata and controls

46 lines (33 loc) · 866 Bytes

Bootstrap Switch Widget for Yii2

Renders a Bootstrap Toggle Switch plugin widget.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist oakcms/yii2-bootstrap-switch "*"

or add

"oakcms/yii2-bootstrap-switch": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?= $form->field($model, 'field')->widget(\oakcms\bootstrapswitch\Switcher::className()) ?>

Or

<?= \oakcms\bootstrapswitch\Switcher::widget([
    'name' => 'Name',
    'checked' => true,
    'clientOptions' => [
        'size' => 'large',
        'onColor' => 'success',
        'offColor' => 'danger'
    ]
]); ?>