src/Form/ContactFranchiseType.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\ContactFranchise;
  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\SubmitType;
  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\TelType;
  11. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  12. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  13. class ContactFranchiseType extends AbstractType
  14. {
  15.     public function buildForm(FormBuilderInterface $builder, array $options): void
  16.     {
  17.         $builder
  18.             ->add('nom'TextType::class, array('label' => 'Nom'))
  19.             ->add('prenom'TextType::class, array('label' => 'Prénom'))
  20.             ->add('email'EmailType::class, array('label' => 'Email'))
  21.             ->add('telephone'TelType::class, array('label' => 'Téléphone'))
  22.             ->add('adresse'TextType::class, array('label' => 'Adresse''required' => false))
  23.             ->add('postal'TextType::class, array('label' => 'Code postal''required' => false))
  24.             ->add('ville'TextType::class, array('label' => 'Ville''required' => false))
  25.             ->add('zone'TextType::class, array('label' => 'Zone restaurant ou région souhaitée'))
  26.             ->add('optin'CheckboxType::class, array('mapped' => false))
  27.             ->add('situation'ChoiceType::class, [
  28.                 'choices'  => [
  29.                     'Demandeur d\'emploi' => 'Demandeur d\'emploi',
  30.                     'Salarié' => 'Salarié',
  31.                     'Entrepreneur' => 'Entrepreneur',
  32.                     'Etudiant' => 'Etudiant',
  33.                     'Autre' => 'Autre',
  34.                 ],
  35.             ])
  36.             ->add('apport'ChoiceType::class, [
  37.                 'choices'  => [
  38.                     '< 60.000 €' => '< 60.000',
  39.                     '60.000 - 80.000 €' => '60.000 - 80.000',
  40.                     '80.000 - 200.000 €' => '80.000 - 200.000',
  41.                     '> 200.000 €' => '> 200.000',
  42.                     '> 500.000 €' => '> 500.000',
  43.                 ],
  44.             ])
  45.             
  46.             ->add('save'SubmitType::class  ,array(
  47.                 'label' => 'Enregistrer'
  48.                 'attr' => ['class' => 'button']
  49.                 ))
  50.         ;
  51.     }
  52.     public function configureOptions(OptionsResolver $resolver): void
  53.     {
  54.         $resolver->setDefaults([
  55.             'data_class' => ContactFranchise::class,
  56.         ]);
  57.     }
  58. }