This is the structure of $this->request->data:
array(
'Capture' => array(
'items' => array (
0 => array(
'description' => '',
'amount' => ''
)
1 => array(
'description' => '',
'amount' => ''
)
)
)
)
And I have to validate this.
To validate multiple records with the same fields, you can use
Model::saveAlland pass in a parameter telling it to only validate.Note that I don’t think you can pass in your
$this->request->data(theitemslevel would throw it off) in the above format. It needs to either be in the format:OR:
So pass it into the function in the following way:
Here is a similar question:
Validating multiple fields with the same name