public $fields = [];
public function rules() {
return [
...
['fields', 'validateFields'],
...
];
}
public function validateFields() {
for ($i = 0; $i < count($this->fields); ++$i) {
...
}
}
<?php $form->field($model, 'fields[]') ?>