PHP code example of loveorigami / yii2-bootstrap-toggle
1. Go to this page and download the library: Download loveorigami/yii2-bootstrap-toggle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
loveorigami / yii2-bootstrap-toggle example snippets
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)
]
)
<?= $form->field($model, 'status')->widget(Toggle::className(),
[
'options' =>[
'id' => 'my-id',
]
]
);
php composer.phar