File tree Expand file tree Collapse file tree 1 file changed +20
-18
lines changed Expand file tree Collapse file tree 1 file changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -12,40 +12,42 @@ The preferred way to install this extension is through [composer](http://getcomp
12
12
13
13
Either run
14
14
15
- ```
16
- php composer.phar require --prefer-dist yii2mod/yii2-chosen-select "*"
15
+ ``` sh
16
+ composer require yii2mod/yii2-chosen-select
17
17
```
18
18
19
19
or add
20
20
21
21
``` json
22
- "yii2mod/yii2-chosen-select" : " * "
22
+ "yii2mod/yii2-chosen-select" : " ^1.0 "
23
23
```
24
24
25
25
to the require section of your composer.json.
26
26
27
27
Usage
28
28
------------
29
+
29
30
1 ) Usage with ActiveForm and model
31
+
30
32
``` php
31
- echo $form->field($model, 'subject')->widget(\yii2mod\chosen\ChosenSelect::className(),[
32
- 'items' => [
33
- 'first' => 'First',
34
- 'second' => 'Second'
35
- ],
36
- ]);
37
-
38
- ```
33
+ echo $form->field($model, 'subject')->widget(\yii2mod\chosen\ChosenSelect::class, [
34
+ 'items' => [
35
+ 'first' => 'First',
36
+ 'second' => 'Second'
37
+ ],
38
+ ]);
39
+ ```
39
40
40
41
2 ) Usage without a model
42
+
41
43
``` php
42
- echo \yii2mod\chosen\ChosenSelect::widget([
43
- 'name' => 'select',
44
- 'items' => BooleanEnum::listData(),
45
- 'options' => [
46
- 'width' => '95%'
47
- ]
48
- ]);
44
+ echo \yii2mod\chosen\ChosenSelect::widget([
45
+ 'name' => 'select',
46
+ 'items' => BooleanEnum::listData(),
47
+ 'options' => [
48
+ 'width' => '95%'
49
+ ]
50
+ ]);
49
51
```
50
52
51
53
Select Options
You can’t perform that action at this time.
0 commit comments