0% found this document useful (0 votes)
10 views2 pages

Code Dynamic Access Condition

Uploaded by

Duy Dat Le
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Code Dynamic Access Condition

Uploaded by

Duy Dat Le
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<div class="col-md-11 select_website">

<label>Chọn Website</label>
<?php $form = ActiveForm::begin(['id' => 'dynamic-
form']); ?>

<?php DynamicFormWidget::begin([
'widgetContainer' => 'dynamicform_wrapper',
'widgetBody' => '.container-items',
'widgetItem' => '.forms-item',
'limit' => 20,
'min' => 1,
'insertButton' => '.add-forms-item',
'deleteButton' => '.remove-forms-item',
'model' => $modelsWebsiteField[0],
'formId' => 'dynamic-form',
'formFields' => [
'image',
'url'
],
]); ?>

<table class="table table-bordered table-striped">


<thead>
<tr>
<th style="width: 40%;"></th>
<th style="width: 18%;"></th>
<th class="text-center" style="width: 2%;">
<button type="button" class="add-forms-item btn
btn-success btn-xs">
<span class="fa fa-plus"></span>
</button>
</th>
</tr>
</thead>
<tbody class="container-items">
<?php foreach ($modelsWebsiteField as $index =>
$modelField): ?>
<tr class="forms-item">
<td class="vcenter" style="width: 40%;">
<?= $form->field($modelField,
"[{$index}]image")->label(false)->textInput(['maxlength' => true]) ?>
</td>
<td class="vcenter" style="width: 18%;">
<?= $form->field($modelField,
"[{$index}]url")->label(false)->textInput(['maxlength' => true]) ?>
</td>
<td class="text-center vcenter" style="width:
2%;">
<button type="button" class="remove-forms-
item btn btn-danger btn-xs">
<span class="fa fa-minus"></span>
</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

<?php DynamicFormWidget::end(); ?>


<?php ActiveForm::end(); ?>
</div>

You might also like