Closed
Description
I tried to use 'group_by' option with a call to a static method.
$form = $this->createFormBuilder()
->add('files', 'choice', [
'choices' => [/* Some Choices */],
'choices_as_values' => true,
'group_by' => 'MyStatic::method'
])
->getForm();
Here is a dummy code sample of what I'm doing.
I saw in Symfony\Component\Form\ChoiceList\Factory\PropertyAccessDecorator::createView
line 203, the test is if (is_string($groupBy))
.
I think it should be if (is_string($groupBy) && !is_callable($groupBy))
.
I have test with option choice_value, and other new options, but this bug may exists for those ones too.
Metadata
Metadata
Assignees
Labels
No labels