Description
I am using child forms to prevent code duplication as explained here: https://symfony.com/doc/current/form/inherit_data_option.html
But this result in "nested" fields names for child forms (foo[address]
, foo[zipcode]
, etc...).
In a classical web application, this is not a problem because Symfony render form HTML and we don't really care about fields names.
But when using it for an API application, we want all the request parameters as the same level and not in a nested sub level.
Actually it's possible to set an empty form name on the root form only.
Why can't we make it possible on child forms too?
Maybe another way exists to add field of a form type we want to include in our form at the same level of the current form?