Skip to content

Commit 19377ca

Browse files
Add one more image to README.md
1 parent ad43b3d commit 19377ca

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,64 @@ use unclead\multipleinput\MultipleInput;
5050
->label(false);
5151
?>
5252
```
53+
See more in [single column](https://github.com/unclead/yii2-multiple-input/wiki/Usage#one-column)
54+
55+
## Advanced usage
56+
57+
![Multiple columns example](https://raw.githubusercontent.com/unclead/yii2-multiple-input/master/resources/images/multiple-column.gif)
58+
59+
For example you want to have an interface for manage user schedule. For simplicity we will store the schedule in json string.
60+
In this case you can use yii2-multiple-input widget like in the following code
61+
62+
```php
63+
use unclead\multipleinput\MultipleInput;
64+
65+
...
66+
67+
<?= $form->field($model, 'schedule')->widget(MultipleInput::className(), [
68+
'max' => 4,
69+
'columns' => [
70+
[
71+
'name' => 'user_id',
72+
'type' => 'dropDownList',
73+
'title' => 'User',
74+
'defaultValue' => 1,
75+
'items' => [
76+
1 => 'User 1',
77+
2 => 'User 2'
78+
]
79+
],
80+
[
81+
'name' => 'day',
82+
'type' => \kartik\date\DatePicker::className(),
83+
'title' => 'Day',
84+
'value' => function($data) {
85+
return $data['day'];
86+
},
87+
'items' => [
88+
'0' => 'Saturday',
89+
'1' => 'Monday'
90+
],
91+
'options' => [
92+
'pluginOptions' => [
93+
'format' => 'dd.mm.yyyy',
94+
'todayHighlight' => true
95+
]
96+
]
97+
],
98+
[
99+
'name' => 'priority',
100+
'title' => 'Priority',
101+
'enableError' => true,
102+
'options' => [
103+
'class' => 'input-priority'
104+
]
105+
]
106+
]
107+
]);
108+
?>
109+
```
110+
See more in [multiple columns](https://github.com/unclead/yii2-multiple-input/wiki/Usage#multiple-columns)
53111

54112
## Documentation
55113

0 commit comments

Comments
 (0)