feature #26408 Readd 'form_label_errors' block to disable errors on form labels (birkof)
This PR was merged into the 3.4 branch. Discussion ---------- Readd 'form_label_errors' block to disable errors on form labels | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | License | MIT Re-added **form_label_errors** block on bootstrap 4 form themes. You can disable errors shown on form labels by simply extend bootstrap4 layout and empty **form_label_errors** block. See below: ``` {% use "bootstrap_4_layout.html.twig" %} {# Disable errors shown on form labels #} {% block form_label_errors %}{% endblock form_label_errors %} ``` Block previously removed [here](b375957c8b (diff-62cb2a10f5a37db0e87e3bd81609b17dR186)
) by @nicolas-grekas. cc @Nyholm Commits -------5b4354f46c
Readd 'form_label_errors' block to disable errors on form labels
This commit is contained in:
commit
2c838f94b3
@ -203,7 +203,7 @@
|
|||||||
{% set label = name|humanize %}
|
{% set label = name|humanize %}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{{- form_errors(form) -}}</{{ element|default('label') }}>
|
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{% block form_label_errors %}{{- form_errors(form) -}}{% endblock form_label_errors %}</{{ element|default('label') }}>
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
{%- if errors|length > 0 -%}
|
{%- if errors|length > 0 -%}
|
||||||
<div id="{{ id }}_errors" class="mb-2">
|
<div id="{{ id }}_errors" class="mb-2">
|
||||||
|
Reference in New Issue
Block a user