MopaBootstrapBundle icon indicating copy to clipboard operation
MopaBootstrapBundle copied to clipboard

Sections in forms

Open vialcollet opened this issue 7 years ago • 1 comments

Hi is it possible to setup sections in forms (other than tabs)? I didn't see any option in the doc. One solution would be to assign a specific call to the first field of a section but I don't know how to assign it to the form-group div rather than to the input itself. Ideas are welcome. Thanks!

vialcollet avatar Aug 05 '18 16:08 vialcollet

You can add a form as a child:

$subform = $builder->create('form');
$subform->add('field1', ...);
$subform->add('field2', ...);

$builder->add($subform)

And add any classes you might want. Really this is probably better solved in your view than in your forms, once you start doing stuff like this you'll have to structure your data differently to fit into sub arrays unless you use inherit_data.

isometriks avatar Aug 07 '18 01:08 isometriks