@@ -207,7 +207,7 @@ private function getRowTemplate()
207
207
$ hiddenInputs = [];
208
208
foreach ($ this ->columns as $ columnIndex => $ column ) {
209
209
/* @var $column MultipleInputColumn */
210
- $ value = $ column ->name . '_value ' ;
210
+ $ value = ' multiple- ' . $ column ->name . '-value ' ;
211
211
$ this ->replacementKeys [$ value ] = $ column ->defaultValue ;
212
212
$ value = '{ ' . $ value . '} ' ;
213
213
@@ -238,7 +238,7 @@ private function collectJsTemplates()
238
238
{
239
239
$ this ->jsTemplates = [];
240
240
foreach ($ this ->getView ()->js [View::POS_READY ] as $ key => $ js ) {
241
- if (preg_match ('/\(.#[^)]+{index}[^)]+\)/ ' , $ js ) === 1 ) {
241
+ if (preg_match ('/\(.#[^)]+{multiple- index}[^)]+\)/ ' , $ js ) === 1 ) {
242
242
$ this ->jsTemplates [] = $ js ;
243
243
unset($ this ->getView ()->js [View::POS_READY ][$ key ]);
244
244
}
@@ -257,10 +257,10 @@ private function renderActionColumn()
257
257
[
258
258
'tagName ' => 'div ' ,
259
259
'encodeLabel ' => false ,
260
- 'label ' => Html::tag ('i ' , null , ['class ' => 'glyphicon glyphicon-{btn_action } ' ]),
260
+ 'label ' => Html::tag ('i ' , null , ['class ' => 'glyphicon glyphicon-{multiple-btn-action } ' ]),
261
261
'options ' => [
262
262
'id ' => $ this ->getElementId ('button ' ),
263
- 'class ' => "{btn_type } multiple-input-list__btn btn js-input-{btn_action } " ,
263
+ 'class ' => "{multiple-btn-type } multiple-input-list__btn btn js-input-{multiple-btn-action } " ,
264
264
]
265
265
]
266
266
);
@@ -281,19 +281,19 @@ private function renderRow($index, $data = null)
281
281
{
282
282
$ btnAction = $ index == 0 ? self ::ACTION_ADD : self ::ACTION_REMOVE ;
283
283
$ btnType = $ index == 0 ? 'btn-default ' : 'btn-danger ' ;
284
- $ search = ['{index} ' , '{btn_action } ' , '{btn_type } ' ];
284
+ $ search = ['{multiple- index} ' , '{multiple-btn-action } ' , '{multiple-btn-type } ' ];
285
285
$ replace = [$ index , $ btnAction , $ btnType ];
286
286
287
287
foreach ($ this ->columns as $ column ) {
288
288
/* @var $column MultipleInputColumn */
289
- $ search [] = '{ ' . $ column ->name . '_value } ' ;
289
+ $ search [] = '{multiple- ' . $ column ->name . '-value } ' ;
290
290
$ replace [] = $ column ->prepareValue ($ data );
291
291
}
292
292
293
293
$ row = str_replace ($ search , $ replace , $ this ->getRowTemplate ());
294
294
295
295
foreach ($ this ->jsTemplates as $ js ) {
296
- $ this ->getView ()->registerJs (strtr ($ js , ['{index} ' => $ index ]), View::POS_READY );
296
+ $ this ->getView ()->registerJs (strtr ($ js , ['{multiple- index} ' => $ index ]), View::POS_READY );
297
297
}
298
298
return $ row ;
299
299
}
@@ -308,7 +308,7 @@ private function renderRow($index, $data = null)
308
308
public function getElementName ($ name , $ index = null )
309
309
{
310
310
if ($ index === null ) {
311
- $ index = '{index} ' ;
311
+ $ index = '{multiple- index} ' ;
312
312
}
313
313
return $ this ->getInputNamePrefix ($ name ) . (
314
314
count ($ this ->columns ) > 1
@@ -367,8 +367,8 @@ public function registerClientScript()
367
367
'id ' => $ this ->getId (),
368
368
'template ' => $ this ->getRowTemplate (),
369
369
'jsTemplates ' => $ this ->jsTemplates ,
370
- 'btn_action ' => self ::ACTION_REMOVE ,
371
- 'btn_type ' => 'btn-danger ' ,
370
+ 'btnAction ' => self ::ACTION_REMOVE ,
371
+ 'btnType ' => 'btn-danger ' ,
372
372
'limit ' => $ this ->limit ,
373
373
'replacement ' => $ this ->replacementKeys ,
374
374
]
0 commit comments