PHP code example of alexeevdv / yii2-bootstrap-toggle
1. Go to this page and download the library: Download alexeevdv/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/ */
alexeevdv / yii2-bootstrap-toggle example snippets
use alexeevdv\yii\BootstrapToggleWidget;
//...
echo $form->field($model, 'attribute')->widget(BootstrapToggleWidget::class);
//...
BootstrapToggleWidget::widget([
/**
* Wrapper tag name. If set to false no tag will be rendered
*/
'container' => 'div',
/**
* Wrapper HTML attributes
*/
'containerOptions' => [],
/**
* Label when checkbox is checked
*/
'labelEnabled' => 'Yes',
/**
* Label when checkbox is not checked
*/
'labelDisabled' => 'No',
/**
* Value when checkbox is checked
*/
'valueEnabled' => '1',
/**
* Value when checkbox is not checked
*/
'valueDisabled' => '0',
/**
* Additional javascript options to Bootstrap Toggle plugin
*/
'pluginOptions' => [],
]);
$ php composer.phar
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.