-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
Symfony version(s) affected
5.3.11
Description
Hi everebody.
Since symfony version 5.3.11 and more specifically twig-bridge version 5.3.11 https://github.com/symfony/twig-bridge/releases/tag/v5.3.11 the label_attr of my symfony form no longer works.
If I go back to twig-bridge 5.3.7 it works normally.
My symfony code :
->add('type', ChoiceType::class, [
'choices' => array(
"choice1" => 8,
"choice2" => 4,
"choice3" => 9,
),
'attr' => [ 'class' => 'd-flex justify-content-between flex-wrap custom-control custom-radio pl-0 ml-2 mt-0 mt-lg-4'],
// Label
'choice_label' => function ($choice, $key, $value) {
return ucfirst($key);
},
"label_attr" => ["class" => "custom-control-label pl-1 mb-4 mr-3"],
// Input
'choice_attr' => function ($choice, $key, $value) {
return ['class' => 'custom-control-input'];
},
'data' => 8,
'label' => false,
'multiple' => false,
'expanded' => true
]
My Twig code :
{{ form_widget(form.type) }}
How to reproduce
Use bootstrap 4 form theme with symfony form ChoiceType and twig-bridge 5.3.11.
Possible Solution
I think the code for version 5.3.11 fixes some problem but apparently it creates more, or am I doing something wrong ?
Additional Context
Thank for the help !