Skip to content

Commit 8743faf

Browse files
mpiotxabbuh
authored andcommitted
Add help_attr
1 parent 437c4a1 commit 8743faf

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

Extension/Core/Type/FormType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
9090
'size' => null,
9191
'label_attr' => $options['label_attr'],
9292
'help' => $options['help'],
93+
'help_attr' => $options['help_attr'],
9394
'compound' => $formConfig->getCompound(),
9495
'method' => $formConfig->getMethod(),
9596
'action' => $formConfig->getAction(),
@@ -180,11 +181,13 @@ public function configureOptions(OptionsResolver $resolver)
180181
'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.',
181182
'upload_max_size_message' => $uploadMaxSizeMessage, // internal
182183
'help' => null,
184+
'help_attr' => array(),
183185
));
184186

185187
$resolver->setAllowedTypes('label_attr', 'array');
186188
$resolver->setAllowedTypes('upload_max_size_message', array('callable'));
187189
$resolver->setAllowedTypes('help', array('string', 'null'));
190+
$resolver->setAllowedTypes('help_attr', 'array');
188191
}
189192

190193
/**

Tests/Fixtures/Descriptor/resolved_form_type_1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"data",
3636
"disabled",
3737
"help",
38+
"help_attr",
3839
"inherit_data",
3940
"label",
4041
"label_attr",

Tests/Fixtures/Descriptor/resolved_form_type_1.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (Block prefix: "choice")
1515
expanded data
1616
group_by disabled
1717
multiple help
18-
placeholder inherit_data
19-
preferred_choices label
18+
placeholder help_attr
19+
preferred_choices inherit_data
20+
label
2021
label_attr
2122
label_format
2223
mapped

Tests/Fixtures/Descriptor/resolved_form_type_2.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"empty_data",
1616
"error_bubbling",
1717
"help",
18+
"help_attr",
1819
"inherit_data",
1920
"label",
2021
"label_attr",

Tests/Fixtures/Descriptor/resolved_form_type_2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Symfony\Component\Form\Extension\Core\Type\FormType (Block prefix: "form")
1717
empty_data
1818
error_bubbling
1919
help
20+
help_attr
2021
inherit_data
2122
label
2223
label_attr

0 commit comments

Comments
 (0)