src/Form/Contact/CommercialType.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Form\Contact;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  5. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  6. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  7. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  8. use Symfony\Component\Form\Extension\Core\Type\TextType;
  9. use Symfony\Component\Form\FormBuilderInterface;
  10. use Symfony\Component\OptionsResolver\OptionsResolver;
  11. class CommercialType extends AbstractType
  12. {
  13.     public function buildForm(FormBuilderInterface $builder, array $options): void
  14.     {
  15.         $builder
  16.             ->add('name'TextType::class, 
  17.             [
  18.                 'label'             => 'Prenom',
  19.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  20.                 'attr'              => ['class' => 'form-control']
  21.             ])
  22.             ->add('last_name'TextType::class, 
  23.             [
  24.                 'label'             => 'Nom',
  25.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  26.                 'attr'              => ['class' => 'form-control']
  27.             ])
  28.             ->add('compagny_name'TextType::class, 
  29.             [
  30.                 'label'             => 'Nom de la structure',
  31.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  32.                 'attr'              => ['class' => 'form-control'],
  33.                 'required'          => false
  34.             ])
  35.             ->add('compagny_type'ChoiceType::class, 
  36.             [
  37.                 'choices'  => [
  38.                     'Association'       => 'Association',
  39.                     'Académie'          => 'Académie',
  40.                     'Salle de sport'    => 'salle de sport',
  41.                     'Coach'             => 'Coach',
  42.                     'Hôtel'             => 'Hôtel',
  43.                     'Club de sport'     => 'Club',
  44.                     'Collectivité'      => 'Collectivité'
  45.                 ],
  46.                 'label'             => 'Type de structure',
  47.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  48.                 'attr'              => ['class' => 'form-control']
  49.             ])
  50.             ->add('country_code'HiddenType::class, 
  51.             [
  52.                 'label'             => '',
  53.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  54.                 'attr'              => ['class' => 'form-control''value' => '+33']
  55.             ])
  56.             ->add('phone'TextType::class, 
  57.             [
  58.                 'label'             => 'Téléphone',
  59.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  60.                 'attr'              => ['class' => 'form-control'],
  61.                 'required'          => false
  62.             ])
  63.             ->add('email'EmailType::class, 
  64.             [
  65.                 'label'             => 'E-mail',
  66.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  67.                 'attr'              => ['class' => 'form-control']
  68.             ])
  69.             ->add('message'TextareaType::class, 
  70.             [
  71.                 'label'             => 'Dîtes-nous tout',
  72.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  73.                 'attr'              => [
  74.                     'class' => 'form-control unl-resize',
  75.                     'rows'  => '5'
  76.                 ]
  77.             ])
  78.         ;
  79.     }
  80.     public function configureOptions(OptionsResolver $resolver): void
  81.     {
  82.         $resolver->setDefaults([
  83.             // Configure your form options here
  84.         ]);
  85.     }
  86. }