oakcms/yii2-bootstrap-switch

Renders a Bootstrap Toggle Switch plugin widget.

Installs: 352

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

v1.0.0 2016-06-01 14:47 UTC

This package is not auto-updated.

Last update: 2024-04-22 11:01:40 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'
    ]
]); ?>