oakcms / yii2-bootstrap-switch
Renders a Bootstrap Toggle Switch plugin widget.
Installs: 353
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/bootstrap-switch: *
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-11-18 13:54:21 UTC
README
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' ] ]); ?>