mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 21:13:57 +00:00
wip: use GenderIconEnum to allow user to select bootstrap icon
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Chill\MainBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Entity\Gender;
|
||||
use Chill\MainBundle\Entity\GenderEnum;
|
||||
use Chill\MainBundle\Entity\GenderIconEnum;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
@@ -20,7 +21,13 @@ class GenderType extends AbstractType
|
||||
->add('label', TranslatableStringFormType::class, [
|
||||
'required' => true,
|
||||
])
|
||||
->add('icon', TextType::class)
|
||||
->add('icon', ChoiceType::class, [
|
||||
'choices' => GenderIconEnum::cases(),
|
||||
'expanded' => true,
|
||||
'multiple' => false,
|
||||
'mapped' => true,
|
||||
'label' => 'Select Gender Icon',
|
||||
])
|
||||
->add('genderTranslation', ChoiceType::class, [
|
||||
'choices' => GenderEnum::cases(),
|
||||
'choice_label' => fn(GenderEnum $enum) => ucfirst(strtolower($enum->name)),
|
||||
|
Reference in New Issue
Block a user