diff --git a/src/Bundle/ChillMainBundle/Form/GenderType.php b/src/Bundle/ChillMainBundle/Form/GenderType.php index cf49d24aa..76d2a4345 100644 --- a/src/Bundle/ChillMainBundle/Form/GenderType.php +++ b/src/Bundle/ChillMainBundle/Form/GenderType.php @@ -8,6 +8,7 @@ use Chill\MainBundle\Entity\GenderIconEnum; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\EnumType; use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; @@ -21,18 +22,25 @@ class GenderType extends AbstractType ->add('label', TranslatableStringFormType::class, [ 'required' => true, ]) +/* ->add('icon', EnumType::class, [ + 'class' => GenderIconEnum::class, + 'label_html' => true, + 'expanded' => false, + 'mapped' => true, + ])*/ ->add('icon', ChoiceType::class, [ 'choices' => GenderIconEnum::cases(), 'expanded' => true, 'multiple' => false, 'mapped' => true, - 'label' => 'Select Gender Icon', + 'choice_label' => fn(GenderIconEnum $enum) => '', + 'choice_value' => fn(?GenderIconEnum $enum) => $enum ? $enum->value : null, + 'label' => 'gender.admin.Select Gender Icon', + 'label_html' => true, ]) - ->add('genderTranslation', ChoiceType::class, [ - 'choices' => GenderEnum::cases(), - 'choice_label' => fn(GenderEnum $enum) => ucfirst(strtolower($enum->name)), - 'choice_value' => fn(?GenderEnum $enum) => $enum ? $enum->value : null, - 'data_class' => null, + ->add('genderTranslation', EnumType::class, [ + 'class' => GenderEnum::class, + 'label' => 'gender.admin.Select Gender Translation', ]) ->add('active', ChoiceType::class, [ 'choices' => [