Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sections in forms #1238

Open
vialcollet opened this issue Aug 5, 2018 · 1 comment
Open

Sections in forms #1238

vialcollet opened this issue Aug 5, 2018 · 1 comment

Comments

@vialcollet
Copy link

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!

@isometriks
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants