I am trying to use any automatic error checking and display processing for a form using multiple objects.
The user can dynamically create several new objects through the UI form. Data is routed through newEntities():
$this->MyModel->newEntities($data);
The first part of the problem that I have is that in order to check whether it was not possible to check on any of the entities, I have to do this manually, checking each object:
$errors = false;
foreach ($entities as $entity) {
if ($entity->errors()) {
$errors = true;
break;
}
}
if (!$errors) {
Does Cake provide anything out of the box that allows you newEntities()to check if you could not verify on any of your entities? If not, then it doesn’t matter ...
, , inline .
<?= $this->Form->create(); ?>
create(), ? , , , , , .
, $i , .
$this->Form->hidden("MyModel.$i.field");