You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
11 years ago
|
JUI Extension for Yii 2
|
||
|
=======================
|
||
12 years ago
|
|
||
11 years ago
|
This is the JQuery UI extension for Yii 2. It encapsulates JQuery UI widgets as Yii widgets,
|
||
|
and makes using JQuery UI widgets in Yii applications extremely easy. For example, the following
|
||
|
single line of code in a view file would render a JQuery UI DatePicker widget:
|
||
12 years ago
|
|
||
11 years ago
|
```php
|
||
11 years ago
|
<?= yii\jui\DatePicker::widget(['name' => 'attributeName']) ?>
|
||
|
```
|
||
|
|
||
|
Configuring the Jquery UI options should be done using the clientOptions attribute:
|
||
|
```php
|
||
|
<?= yii\jui\DatePicker::widget(['name' => 'attributeName', 'clientOptions' => ['dateFormat' => 'yy-mm-dd']]) ?>
|
||
|
```
|
||
|
|
||
|
If you want to use the JUI widget in an ActiveRecord form, it can be done like this:
|
||
|
```php
|
||
|
<?= $form->field($model,'attributeName')->widget(DatePicker::className(),['clientOptions' => ['dateFormat' => 'yy-mm-dd']]) ?>
|
||
11 years ago
|
```
|
||
12 years ago
|
|
||
12 years ago
|
|
||
12 years ago
|
Installation
|
||
12 years ago
|
------------
|
||
|
|
||
11 years ago
|
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
|
||
12 years ago
|
|
||
|
Either run
|
||
11 years ago
|
|
||
12 years ago
|
```
|
||
12 years ago
|
php composer.phar require yiisoft/yii2-jui "*"
|
||
12 years ago
|
```
|
||
|
|
||
|
or add
|
||
11 years ago
|
|
||
12 years ago
|
```
|
||
|
"yiisoft/yii2-jui": "*"
|
||
|
```
|
||
|
|
||
11 years ago
|
to the require section of your `composer.json` file.
|
||
12 years ago
|
|