Skip to content

Commit bddeb19

Browse files
committed
Added notes about nested MultipleInput to the docs
1 parent ba46b00 commit bddeb19

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

UPGRADE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ if you want to upgrade from version A to version C and there is
88
version B between A and C, you need to following the instructions
99
for both A and B.
1010

11+
Upgrade from 1.2 to 1.3
12+
-----------------------
13+
14+
- The mechanism of customization configuration by using index placeholder was changed in scope of implementing support of nested `MultipleInput`
15+
If you customize configuration by using index placeholder you have to add ID of widget to the placeholder.
16+
For example, `multiple_index` became `multiple_index_question_list`
17+
18+
1119
Upgrade from version less then 1.1.0
1220
------------------------------------
1321

docs/tips.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,36 @@ as in the example below:
149149

150150
##Embedded MultipleInput widget <a id="embedded"></a>
151151

152-
TBD
152+
You can use nested `MultipleInput` as in the example below:
153+
154+
```
155+
echo MultipleInput::widget([
156+
'model' => $model,
157+
'attribute' => 'questions',
158+
'attributeOptions' => $commonAttributeOptions,
159+
'columns' => [
160+
[
161+
'name' => 'question',
162+
'type' => 'textarea',
163+
],
164+
[
165+
'name' => 'answers',
166+
'type' => MultipleInput::class,
167+
'options' => [
168+
'attributeOptions' => $commonAttributeOptions,
169+
'columns' => [
170+
[
171+
'name' => 'right',
172+
'type' => MultipleInputColumn::TYPE_CHECKBOX
173+
],
174+
[
175+
'name' => 'answer'
176+
]
177+
]
178+
]
179+
]
180+
],
181+
]);
182+
```
183+
184+
But in this case you have to pass `attributeOptions` to the widget otherwise you will not be able to use ajax or client side validation of data.

0 commit comments

Comments
 (0)