yii2-bootstrap-toggle Bootstrap toggle widget for Yii 2

Bootstrap Toggle widget for Yii 2

  1. Installation
  2. General Usage

This extension provides the Bootstrap-toggle integration for the Yii2 framework.

More information on https://github.com/loveorigami/yii2-bootstrap-toggle

Installation

This extension requires Bootstrap-toggle

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist loveorigami/yii2-bootstrap-toggle "*"

or add

"loveorigami/yii2-bootstrap-toggle": "*"

to the require section of your composer.json.

General Usage

use lo\widgets\Toggle;

Toggle::widget(
    [
        'name' => 'status', // input name. Either 'name', or 'model' and 'attribute' properties must be specified.
        'checked' => true,
        'options' => [], // checkbox options. More data html options [see here](http://www.bootstraptoggle.com)
    ]
)

or with active form as

<?= $form->field($model, 'status')->widget(Toggle::className()); ?>

0 0
1 follower
0 downloads
Yii Version: 2.0
License: BSD-2-Clause
Category: User Interface
Developed by: loveorigami
Created on: Aug 14, 2015
Last updated: 8 years ago

Related Extensions