Skip to content

Commit 1c0fb8b

Browse files
mpiotnicolas-grekas
authored andcommitted
[Form][TwigBridge] Add help_html option
1 parent 582c7ff commit 1c0fb8b

File tree

6 files changed

+8
-0
lines changed

6 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
-----
66

77
* added `block_prefix` option to `BaseType`.
8+
* added `help_html` option to display the `help` text as HTML.
89

910
4.2.0
1011
-----

Extension/Core/Type/FormType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
9191
'label_attr' => $options['label_attr'],
9292
'help' => $options['help'],
9393
'help_attr' => $options['help_attr'],
94+
'help_html' => $options['help_html'],
9495
'compound' => $formConfig->getCompound(),
9596
'method' => $formConfig->getMethod(),
9697
'action' => $formConfig->getAction(),
@@ -183,12 +184,14 @@ public function configureOptions(OptionsResolver $resolver)
183184
'allow_file_upload' => false,
184185
'help' => null,
185186
'help_attr' => [],
187+
'help_html' => false,
186188
]);
187189

188190
$resolver->setAllowedTypes('label_attr', 'array');
189191
$resolver->setAllowedTypes('upload_max_size_message', ['callable']);
190192
$resolver->setAllowedTypes('help', ['string', 'null']);
191193
$resolver->setAllowedTypes('help_attr', 'array');
194+
$resolver->setAllowedTypes('help_html', 'bool');
192195
}
193196

194197
/**

Tests/Fixtures/Descriptor/resolved_form_type_1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"disabled",
3939
"help",
4040
"help_attr",
41+
"help_html",
4142
"inherit_data",
4243
"label",
4344
"label_attr",

Tests/Fixtures/Descriptor/resolved_form_type_1.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (Block prefix: "choice")
1818
placeholder disabled
1919
preferred_choices help
2020
help_attr
21+
help_html
2122
inherit_data
2223
label
2324
label_attr

Tests/Fixtures/Descriptor/resolved_form_type_2.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"error_bubbling",
1919
"help",
2020
"help_attr",
21+
"help_html",
2122
"inherit_data",
2223
"label",
2324
"label_attr",

Tests/Fixtures/Descriptor/resolved_form_type_2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Symfony\Component\Form\Extension\Core\Type\FormType (Block prefix: "form")
2020
error_bubbling
2121
help
2222
help_attr
23+
help_html
2324
inherit_data
2425
label
2526
label_attr

0 commit comments

Comments
 (0)