-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
Symfony version(s) affected: 4.1.4
Description
If you try to override only a label of a checkbox, the input element disappears.
The custom label is shown once if using ‘form_widget’ and twice if using ‘form_row’, the actual checkbox/input never appears, just the label.
How to reproduce
Use in a twig view:
{% form_theme form _self %}
{% block _user_registration_form_termsAccepted_label %}
<label class="form-check-label required" for="user_registration_form_termsAccepted">{{ 'label.terms_accepted'|trans({ '%terms_and_conditions_link%': path('terms') })|raw }}</label>
{% endblock %}
Render via {{ form_widget(form.termsAccepted) }}
- shows the label once, with an indent (form-check
div wrap)
Render via {{ form_row(form.termsAccepted) }}
- shows the label twice, one without an indent and second with an indent same as with form_widget
Possible Solution
Additional context