8000 Updated a Twig example · symfony/symfony-docs@b1659f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit b1659f1

Browse files
committed
Updated a Twig example
1 parent 3b41eeb commit b1659f1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

validation/severity.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ so that the severity is added as an additional HTML class:
155155
{%- if errors|length > 0 -%}
156156
<ul>
157157
{%- for error in errors -%}
158-
{% if error.constraint.payload.severity is defined %}
159-
{% set severity = error.constraint.payload.severity %}
160-
{% endif %}
161-
<li{% if severity is defined %} class="{{ severity }}"{% endif %}>{{ error.message }}</li>
158+
<li class="{{ error.constraint.payload.severity ?? '' }}">{{ error.message }}</li>
162159
{%- endfor -%}
163160
</ul>
164161
{%- endif -%}

0 commit comments

Comments
 (0)
0