JUI Extension for Yii 2
This is the JQuery UI extension for Yii framework 2.0. It encapsulates JQuery UI widgets as Yii widgets, and makes using JQuery UI widgets in Yii applications extremely easy.
For license information check the LICENSE-file.
Documentation is at docs/guide/README.md.
Installation ¶
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yiisoft/yii2-jui
or add
"yiisoft/yii2-jui": "~2.0.0"
to the require section of your composer.json
file.
Usage ¶
The following single line of code in a view file would render a JQuery UI DatePicker widget:
<?= yii\jui\DatePicker::widget(['name' => 'attributeName']) ?>
Configuring the Jquery UI options should be done using the clientOptions attribute:
<?= yii\jui\DatePicker::widget(['name' => 'attributeName', 'clientOptions' => ['defaultDate' => '2014-01-01']]) ?>
If you want to use the JUI widget in an ActiveForm, it can be done like this:
<?= $form->field($model,'attributeName')->widget(DatePicker::className(),['clientOptions' => ['defaultDate' => '2014-01-01']]) ?>
Class Reference
Class | Description |
---|---|
yii\jui\Accordion | Accordion renders an accordion jQuery UI widget. |
yii\jui\AutoComplete | AutoComplete renders an autocomplete jQuery UI widget. |
yii\jui\DatePicker | DatePicker renders a datepicker jQuery UI widget. |
yii\jui\DatePickerLanguageAsset | |
yii\jui\Dialog | Dialog renders an dialog jQuery UI widget. |
yii\jui\Draggable | Draggable renders an draggable jQuery UI widget. |
yii\jui\Droppable | Droppable renders an droppable jQuery UI widget. |
yii\jui\InputWidget | InputWidget is the base class for all jQuery UI input widgets. |
yii\jui\JuiAsset | |
yii\jui\Menu | Menu renders a menu jQuery UI widget. |
yii\jui\ProgressBar | ProgressBar renders an progressbar jQuery UI widget. |
yii\jui\Resizable | Resizable renders an resizable jQuery UI widget. |
yii\jui\Selectable | Selectable renders a selectable jQuery UI widget. |
yii\jui\Slider | Slider renders a slider jQuery UI widget. |
yii\jui\SliderInput | SliderInput renders a slider jQuery UI widget that writes its value into hidden input. |
yii\jui\Sortable | Sortable renders a sortable jQuery UI widget. |
yii\jui\Spinner | Spinner renders an spinner jQuery UI widget. |
yii\jui\Tabs | Tabs renders a tabs jQuery UI widget. |
yii\jui\Widget | \yii\jui\Widget is the base class for all jQuery UI widgets. |