Embed a collection of form inside a form With Symfony2 I can embed a collection of form inside an another form (subform inside form).
http://symfony.com/doc/current/cookbook/form/form_collections.html

I would like know if it's possible inside Drupal 8 please, The documentation (Drupal 8 - Form API) don't talk about that.

Thanks.
Drupal forms are very different from Symfony forms.

There is no concept of sub-forms, but there is no limit to the complexity a single form can have as a form is an almost arbitrary render array structure.

A commonly used concept there is #tree. By default, the form input element names are flat.

If want to edit multiple elements in the same form, you can build a structure like this:

&lt;?php
$form['#tree'] =&gt; TRUE;
foreach ($things as $id =&gt; $thing) {
 $form['things'][$id]['name'] = ['#type' =&gt; 'textfield', ...]
}


Without #tree, you would have multiple textfields named 'name', when set to TRUE, you get something like name="things[5][name]".

In Drupal 7 and earlier, it was complicated to render those nested forms in a table, you needed custom theme functions that then built the actual table. In Drupal 8, it just works, in the above example, you would just need to add something like $form['things']['#type'] = 'table' and then each $id will be a table row.

Then you can get all those values in the submit method with $form_state->getValue('things') and process them again in a loop.