src/Form/VisitorRegistrationType.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Country;
  4. use App\Entity\User;
  5. use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  6. use Symfony\Component\Form\AbstractType;
  7. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  8. use Symfony\Component\Form\Extension\Core\Type\TextType;
  9. use Symfony\Component\Form\FormBuilderInterface;
  10. use Symfony\Component\OptionsResolver\OptionsResolver;
  11. class VisitorRegistrationType extends AbstractType
  12. {
  13.     public function buildForm(FormBuilderInterface $builder, array $options): void
  14.     {
  15.         $builder
  16.             ->add('email'HiddenType::class, [
  17.                 'label' => 'Email',
  18.                 'attr'  => ['class' => 'form-control con_input height-50''placeholder' => 'Ex: aaaaa@cofina.com']
  19.             ])
  20.             ->add('lastname'TextType::class, [
  21.                 'label' => 'Nom',
  22.                 'label_attr' => ['class' => 'h2 fw-bold opificio'],
  23.                 'attr' => ['class' => 'form-control con_input height-50''placeholder' => 'EX:YAO']
  24.             ])
  25.             ->add('firstname'TextType::class, [
  26.                 'label' => 'PrĂ©nom(s)',
  27.                 'label_attr' => ['class' => 'h2 fw-bold opificio'],
  28.                 'attr' => ['class' => 'form-control con_input height-50''placeholder' => 'EX:YANIEL']
  29.             ])
  30.             ->add('country'EntityType::class, [
  31.                 'class' => Country::class,
  32.                 'choice_label' => 'name',
  33.                 'label' => 'Pays',
  34.                 'label_attr' => ['class' => 'h2 fw-bold opificio'],
  35.                 'attr' => ['class' => 'form-control con_input']
  36.             ])
  37.         ;
  38.     }
  39.     public function configureOptions(OptionsResolver $resolver): void
  40.     {
  41.         $resolver->setDefaults([
  42.             'data_class' => User::class,
  43.         ]);
  44.     }
  45. }