I'm new to symfony and I'm trying to build my registration page. The form and fields are generated through my FormType but I kinda want to change the look of the terms and conditions checkbox.
By default it's label then box, I want to reverse them and put my label on the right side of the box. Is there a way to solve this problem? Thank you in advance!
P粉4236943412024-04-05 19:02:45
I guess you are using {{ form(form) }}
to render the form in twig.
But when you use something like this, you can decide how to render the various parts of the form
{{ form_start(form) }}{{ form_errors(form) }}{{ form_end(form) }}{{ form_row(form.task) }}{{ form_row(form.dueDate) }}
With this knowledge, you should be able to place the label on the right side.
View documentation. There is a nice image that describes the various parts of the form and how to access/render it in twig.
https://symfony.com/doc/current/form/form_customization.html