Skip to content

Commit c012c55

Browse files
przemyslaw-bogusznicolas-grekas
authored andcommitted
[Form] Add label_html attribute
1 parent f5b0ebe commit c012c55

File tree

5 files changed

+7
-0
lines changed

5 files changed

+7
-0
lines changed

Extension/Core/Type/BaseType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
9797
'disabled' => $form->isDisabled(),
9898
'label' => $options['label'],
9999
'label_format' => $labelFormat,
100+
'label_html' => $options['label_html'],
100101
'multipart' => false,
101102
'attr' => $options['attr'],
102103
'block_prefixes' => $blockPrefixes,
@@ -127,6 +128,7 @@ public function configureOptions(OptionsResolver $resolver)
127128
'label' => null,
128129
'label_format' => null,
129130
'row_attr' => [],
131+
'label_html' => false,
130132
'label_translation_parameters' => [],
131133
'attr_translation_parameters' => [],
132134
'attr' => [],
@@ -137,5 +139,6 @@ public function configureOptions(OptionsResolver $resolver)
137139
$resolver->setAllowedTypes('block_prefix', ['null', 'string']);
138140
$resolver->setAllowedTypes('attr', 'array');
139141
$resolver->setAllowedTypes('row_attr', 'array');
142+
$resolver->setAllowedTypes('label_html', 'bool');
140143
}
141144
}

Tests/Fixtures/Descriptor/resolved_form_type_1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"label",
4747
"label_attr",
4848
"label_format",
49+
"label_html",
4950
"label_translation_parameters",
5051
"mapped",
5152
"method",

Tests/Fixtures/Descriptor/resolved_form_type_1.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (Block prefix: "choice")
2626
label
2727
label_attr
2828
label_format
29+
label_html
2930
label_translation_parameters
3031
mapped
3132
method

Tests/Fixtures/Descriptor/resolved_form_type_2.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"label",
2727
"label_attr",
2828
"label_format",
29+
"label_html",
2930
"label_translation_parameters",
3031
"mapped",
3132
"method",

Tests/Fixtures/Descriptor/resolved_form_type_2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Symfony\Component\Form\Extension\Core\Type\FormType (Block prefix: "form")
2828
label
2929
label_attr
3030
label_format
31+
label_html
3132
label_translation_parameters
3233
mapped
3334
method

0 commit comments

Comments
 (0)