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 https://github.com/yiisoft/yii2-jui/blob/master/docs/guide/README.md.
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.
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']]) ?>
yii\jui\Dialog
(mtangoo)yii\jui\Selectable
add support for begin()
, end()
widget methods (fdezmc)jQuery
instead of $
in generated code to avoid conflicts (samdark)yii\jui\AutoComplete::run()
now returns output instead of echoing it (unlimix)1.12.1
as minimum version (samdark)yii\jui\Draggable
was using wrong event names (samdark)yii\jui\Droppable
and yii\jui\Resizable
were using wrong event names (samdark)yii\jui\Spinner
was using wrong event names (samdark)DatePicker
translations, asset was registered without timestamp when asset manager $appendTimestamp
was enabled (samdark)Json::htmlEncode()
for safer JSON data encoding in HTML code (samdark, Tomasz Tokarski)name
or model
and attribute
are no longer required properties of yii\jui\InputWidget
(nirvana-msu, cebe)de-DE
and the translation files does not exists, it will use de
instead (cebe)$dateFormat
which is used to set the clientOption dateFormat
.
The new property does not use the datepicker formatting syntax anymore but uses the same as the yii\i18n\Formatter
class which is the ICU syntax for date formatting, you have to adjust all your DatePicker widgets to use
the new property instead of setting the dateFormat in the clientOptions (cebe)
Comments