javascript - Symfony 4 - Can not customize attr for form field in formBuilder
805
Solution:
You can also pass parameters to form fields when you render the form
{{ form_row(form.activeBorderRadius, {'attr': {'class': 'custom-control-input', 'id': 'toggle-border-radius'}}) }}
{{ form_label(form.activeBorderRadius, {'attr': {'class': 'custom-control-label', 'for': 'toggle-border-radius'}}) }}
Answer
Solution:
You can use a "class" rather than an ID.
If you still want to use ID, you can create your own type in which you specify your code:
How to create your form type see here.