PHP code example of justinvoelker / yii2-awesomebootstrapcheckbox
1. Go to this page and download the library: Download justinvoelker/yii2-awesomebootstrapcheckbox 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/ */
justinvoelker / yii2-awesomebootstrapcheckbox example snippets
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'justinvoelker\awesomebootstrapcheckbox\Asset',
];
$form = ActiveForm::begin([
'fieldClass' => 'justinvoelker\awesomebootstrapcheckbox\ActiveField',
]);
// Disabled checkbox with a customized label
$form->field($model, 'attribute')->checkbox(['label' => 'You cannot check this checkbox', 'disabled'=>true])
// Radio with the bootstrap primary color
$form->field($model, 'attribute')->radio(['divOptions' => ['class' => 'checkbox-primary']])
// List of disabled checkboxes
$form->field($model, 'attribute')->checkboxList([1 => 'First', 2 => 'Second', 3 => 'Third'], ['itemOptions' => ['disabled' => true]])
// Inline list of enabled radio buttons with the bootstrap danger color
$form->field($model, 'attribute')->inline()->radioList([1 => 'First', 2 => 'Second', 3 => 'Third'], ['itemOptions' => ['disabled' => false, 'divOptions' => ['class' => 'radio-danger']]])
'columns' => [
// ...
[
'class' => 'justinvoelker\awesomebootstrapcheckbox\CheckboxColumn',
// you may configure additional properties here
],
]
php composer.phar