Skip to content

Commit c4ed63f

Browse files
author
Igor Chepurnoy
authored
Merge pull request #10 from nadar/patch-1
Using version instead of *
2 parents ab975e4 + d09330b commit c4ed63f

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,42 @@ The preferred way to install this extension is through [composer](http://getcomp
1212

1313
Either run
1414

15-
```
16-
php composer.phar require --prefer-dist yii2mod/yii2-chosen-select "*"
15+
```sh
16+
composer require yii2mod/yii2-chosen-select
1717
```
1818

1919
or add
2020

2121
```json
22-
"yii2mod/yii2-chosen-select": "*"
22+
"yii2mod/yii2-chosen-select": "^1.0"
2323
```
2424

2525
to the require section of your composer.json.
2626

2727
Usage
2828
------------
29+
2930
1) Usage with ActiveForm and model
31+
3032
```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+
```
3940

4041
2) Usage without a model
42+
4143
```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+
]);
4951
```
5052

5153
Select Options

0 commit comments

Comments
 (0)