From 272ed9fb6d9f485403d783964cdecc0eac622312 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Thu, 13 Oct 2022 15:11:11 +0200 Subject: [PATCH] Add support for label_html --- Resources/views/form/form_div_layout.html.twig | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Resources/views/form/form_div_layout.html.twig b/Resources/views/form/form_div_layout.html.twig index 34af91e..9270f0e 100644 --- a/Resources/views/form/form_div_layout.html.twig +++ b/Resources/views/form/form_div_layout.html.twig @@ -273,9 +273,17 @@ {%- endif -%} <{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}> {%- if translation_domain is same as(false) -%} - {{- label -}} + {%- if label_html is same as(false) -%} + {{- label -}} + {%- else -%} + {{- label|raw -}} + {%- endif -%} {%- else -%} - {{- label|trans({}, translation_domain) -}} + {%- if label_html is same as(false) -%} + {{- label|trans({}, translation_domain) -}} + {%- else -%} + {{- label|trans({}, translation_domain)|raw -}} + {%- endif -%} {%- endif -%} {%- endif -%} -- 2.41.1