I have the following data:
Array ( [category] => Array ( [0] => d [1] => 100 [2] => 100 [3] => 100 ) [volume] => Array ( [0] => 100 [1] => 100 [2] => 100 ) [urgency] => Array ( [0] => 100 [1] => 100 [2] => 100 ) [importance] => Array ( [0] => 100 [1] => 100 [2] => 100 ) )
And I created a DynamicModel for it with the rules "every value must be integer" (added in 2.0.4).
$view_model = DynamicModel::validateData(compact('category', 'volume', 'urgency', 'importance'), [ [['category', 'volume', 'urgency', 'importance'], 'each', 'rule' => ['integer']], ]);
I have:
<?= $form->field($model, 'category[0]')->textInput() ?> <?= $form->field($model, 'category[1]')->textInput() ?> <?= $form->field($model, 'category[2]')->textInput() ?> ... <?= $form->field($model, 'importance[2]')->textInput() ?>
The problem is that when I submit the form with "d" on the first input, I have errors for each category entry: 
What am I doing wrong?
source share