79789068

Date: 2025-10-13 08:46:38
Score: 1
Natty:
Report link

You might have found a solution by the time but for others trying to find it :

You need to put the 'category' in your entry_options :

->add('animals', CollectionType::class, [
                'entry_type' => AnimalType::class,
                'entry_options' => [
                    'label' => false,
                    'category' => $options['category'],
                ],
                'allow_add' => true,
                'allow_delete' => true,
                'by_reference' => false,
            ])

And define it in your AnimalType confirgureOptions :

public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => ActivityAnimal::class,
            'category' => null,
        ]);
    }

Have a good day !

Reasons:
  • Blacklisted phrase (1): good day
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Dev Th