Symfony: Access form collection variables from the parent form

This usually goes in the controller after checking if the form submitted is valid:

// Accessing the request vars works this way:
$formSubmit = $request->request->get(‘parentForm’);
$formEntity1 = $formSubmit['entity1'];

$formEntity2 = $formSubmit['entity2']; // This accesses other sub form object for more unmapped vars

$entity1_property = $formEntity1[0]['property_field_name'];
$entity2_property= $forEntity2[0]['property_field_name'];

About Author:

Senior Cloud Software Engineer and 25+ years experienced video production, video editing and 3D animation services for a variety of global clients including local video production here in Jacksonville, Florida.

Leave a Comment

Your email address will not be published. Required fields are marked *