Download the PHP package justinvoelker/yii2-awesomebootstrapcheckbox without Composer
On this page you can find all versions of the php package justinvoelker/yii2-awesomebootstrapcheckbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download justinvoelker/yii2-awesomebootstrapcheckbox
More information about justinvoelker/yii2-awesomebootstrapcheckbox
Files in justinvoelker/yii2-awesomebootstrapcheckbox
Package yii2-awesomebootstrapcheckbox
Short Description Better looking, bootstrap-style checkboxes and radio buttons
License BSD-3-Clause
Informations about the package yii2-awesomebootstrapcheckbox
Awesome Bootstrap Checkbox for Yii2
Implementation of Awesome Bootstrap Checkbox within Yii2.
This extension overrides the ActiveField functions of checkbox
, radio
, checkboxList
, and radioList
.
Additionally, CheckboxColumn
is included to implement the same awesome checkboxes in a GridView widget.
Installation
Install the extension
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Styles
Follow one of the directions below to use the styles necessary for awesome bootstrap checkboxes
Option 1: Manually combine stylesheets
Open your the vendors\justinvoelker\yii2-awesomebootstrapcheckbox\css
directory and add the appropriate styles to your own stylesheet or include them in your less/scss files.
Option 2: Include the delivered asset bundle
Add justinvoelker\awesomebootstrapcheckbox\Asset
as a dependency in your assets\AppAsset
file. It should look similar to the following:
Usage
ActiveField
To use awesome bootstrap checkboxes in your ActiveForm, simply specify the fieldClass
property of the ActiveForm as follows:
Once the fieldClass is specified simply use checkbox, radio, checkboxList, or radioList as needed. The following are some examples of usage.
Keep in mind that at times there are essentially two labels for a given input: one for the entire field, one for that specific checkbox or radio button. Specifying a label() will set the label for the entire field, specifying the label
itemOption will change the label for a single checkbox() or radio() button.
CheckboxColumn
To create a php array of key=>value pairs (where key is the tag and value is the frequency of that tag), use TaggingQuery:
An example of an additional property could be to limit the width of the checkbox column: 'contentOptions' => ['style' => 'width: 25px;'],