src/Form/RejoindreType.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Rejoindre;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\FormBuilderInterface;
  6. use Symfony\Component\OptionsResolver\OptionsResolver;
  7. use Symfony\Component\Form\Extension\Core\Type\FileType;
  8. use Symfony\Component\Form\Extension\Core\Type\TextType;
  9. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  10. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  11. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  12. class RejoindreType extends AbstractType
  13. {
  14.     public function buildForm(FormBuilderInterface $builder, array $options): void
  15.     {
  16.         $builder
  17.             ->add('civilite'ChoiceType::class, [
  18.                 "attr" => array (
  19.                     "class" => "form-control",
  20.                     'required'   => true,
  21.                 ),
  22.                 'choices' => [
  23.                     'Mademoiselle' => 'Mademoiselle',
  24.                     'Madame' => 'Madame',
  25.                     'Monsieur' => 'Monsieur',
  26.                 ],
  27.             ])
  28.             ->add('nom'TextType::class, [
  29.                 "attr" => array (
  30.                     "class" => "form-control",
  31.                     'required'   => true,
  32.                 )
  33.             ])
  34.             ->add('email'EmailType::class, [
  35.                 "attr" => array (
  36.                     "class" => "form-control",
  37.                     'required'   => true,
  38.                 )
  39.             ])
  40.             ->add('telephone'TextType::class, [
  41.                 "attr" => array (
  42.                     "class" => "form-control",
  43.                     'required'   => true,
  44.                 )
  45.             ])
  46.             ->add('apropos'ChoiceType::class, [
  47.                 "attr" => array (
  48.                     "class" => "form-control",
  49.                     'required'   => true,
  50.                 ),
  51.                 'choices' => [
  52.                     'Recherche sur internet' => 'Recherche sur internet',
  53.                     'Recommendé par un ami' => 'Recommendé par un ami',
  54.                     'Revue de presse positive' => 'Revue de presse positive',
  55.                     'Autre' => 'Autre',
  56.                 ],
  57.             ])
  58.             ->add('poste'ChoiceType::class, [
  59.                 "attr" => array (
  60.                     "class" => "form-control",
  61.                     'required'   => true,
  62.                 ),
  63.                 'choices' => [
  64.                     'AVT Consultant' => 'AVT Consultant',
  65.                     'AVT Formation' => 'AVT Formation',
  66.                     'AVT Ingénierie' => 'AVT Ingénierie',
  67.                     'AVT BTP' => 'AVT BTP',
  68.                     'Postuler pour une offre d\'emploi' => 'Postuler pour une offre d\'emploi',
  69.                     'Candidature spontanée' => 'Candidature spontanée',
  70.                 ],
  71.             ])
  72.             ->add('objet'TextType::class, [
  73.                 "attr" => array (
  74.                     "class" => "form-control",
  75.                     'required'   => true,
  76.                 )
  77.             ])
  78.             ->add('message'TextareaType::class, [
  79.                 "attr" => array (
  80.                     "class" => "form-control",
  81.                     'required'   => true,
  82.                 )
  83.             ])
  84.             ->add('fichier'FileType::class, 
  85.                 array(
  86.                     'data_class' => null,
  87.                     'required'   => false,
  88.                 )
  89.             )
  90.         ;
  91.     }
  92.     public function configureOptions(OptionsResolver $resolver): void
  93.     {
  94.         $resolver->setDefaults([
  95.             'data_class' => Rejoindre::class,
  96.         ]);
  97.     }
  98. }