I have problem with the group of the same form. In controller i create a few form like this
foreach($matchEntityList as $entityId => $entityItem) {
$form[$entityId] = $this->createForm(MatchType::class, $matchEntityList[$entityId], [
'matchId' => $entityId,
])->createView();
}
And in view i display each form individual. When i click on submit individual i send id of form in input hidden to controller and i do request on this form.
$formId = $request->request->all()['match']['matchId'];
$form[$formId]->handleRequest($request);
if ($form[$formId]->isSubmitted() && $form[$formId]->isValid()) {
$em->flush($matchEntityList[$formId]);
}
Everything works well but i would like to go a one step forward. I need to have one submit button and when i click him i would like to check all the changes and flush it. You have an idea how to do it?