If you have this form (for example) :
<?php $form = ActiveForm::begin(); ?>
<table>
<?php foreach($models as $model): ?>
<!-- row template -->
<tr>
<td><?= $form->field($model, 'firstName'); ?></td>
<td><?= $form->field($model, 'lastName'); ?></td>
</tr>
<!-- // row template -->
<?php endforeach; ?>
</table>
<?php ActiveForm::end(); ?>
Now, what is the best way that you’d use to get a copy of the code (template) between <!-- row template -->
and <!-- // row template -->
, so you can use it to add new rows dynamically using JavaScript?