Skip to content

Commit c2b9bec

Browse files
committed
adding the new block form_label_content for bootstrap_5_layout.html.twig to simplify it
1 parent f3a9ac1 commit c2b9bec

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_5_layout.html.twig

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -286,33 +286,11 @@
286286
{%- if parent_label_class is defined -%}
287287
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|replace({'checkbox-inline': '', 'radio-inline': ''})|trim}) -%}
288288
{%- endif -%}
289-
{%- if label is not same as(false) and label is empty -%}
290-
{%- if label_format is not empty -%}
291-
{%- set label = label_format|replace({
292-
'%name%': name,
293-
'%id%': id,
294-
}) -%}
295-
{%- else -%}
296-
{%- set label = name|humanize -%}
297-
{%- endif -%}
298-
{%- endif -%}
299289

300290
{{ widget|raw }}
301291
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
302292
{%- if label is not same as(false) -%}
303-
{%- if translation_domain is same as(false) -%}
304-
{%- if label_html is same as(false) -%}
305-
{{- label -}}
306-
{%- else -%}
307-
{{- label|raw -}}
308-
{%- endif -%}
309-
{%- else -%}
310-
{%- if label_html is same as(false) -%}
311-
{{- label|trans(label_translation_parameters, translation_domain) -}}
312-
{%- else -%}
313-
{{- label|trans(label_translation_parameters, translation_domain)|raw -}}
314-
{%- endif -%}
315-
{%- endif -%}
293+
{{- block('form_label_content') -}}
316294
{%- endif -%}
317295
</label>
318296
{%- endif -%}

0 commit comments

Comments
 (0)