src/Form/Contact/InformationType.php line 13

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\EmailType;
  5. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  6. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  7. use Symfony\Component\Form\Extension\Core\Type\TextType;
  8. use Symfony\Component\Form\FormBuilderInterface;
  9. use Symfony\Component\OptionsResolver\OptionsResolver;
  10. class InformationType extends AbstractType
  11. {
  12.     public function buildForm(FormBuilderInterface $builder, array $options): void
  13.     {
  14.         $builder
  15.             ->add('name'TextType::class, 
  16.             [
  17.                 'label'             => 'Prenom',
  18.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  19.                 'attr'              => ['class' => 'form-control']
  20.             ])
  21.             ->add('last_name'TextType::class, 
  22.             [
  23.                 'label'             => 'Nom',
  24.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  25.                 'attr'              => ['class' => 'form-control']
  26.             ])
  27.             ->add('compagny_name'TextType::class, 
  28.             [
  29.                 'label'             => 'Nom de la structure',
  30.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  31.                 'attr'              => ['class' => 'form-control'],
  32.                 'required'          => false
  33.             ])
  34.             ->add('country_code'HiddenType::class, 
  35.             [
  36.                 'label'             => '',
  37.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  38.                 'attr'              => ['class' => 'form-control''value' => '+33']
  39.             ])
  40.             ->add('phone'TextType::class, 
  41.             [
  42.                 'label'             => 'Téléphone',
  43.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  44.                 'attr'              => ['class' => 'form-control'],
  45.                 'required'          => false
  46.             ])
  47.             ->add('email'EmailType::class, 
  48.             [
  49.                 'label'             => 'E-mail',
  50.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  51.                 'attr'              => ['class' => 'form-control']
  52.             ])
  53.             ->add('message'TextareaType::class, 
  54.             [
  55.                 'label'             => 'Dîtes-nous tout',
  56.                 'label_attr'        => ['class' => 'with-margin-top-10'],
  57.                 'attr'              => [
  58.                     'class' => 'form-control unl-resize',
  59.                     'rows'  => '5'
  60.                 ]
  61.             ])
  62.         ;
  63.     }
  64.     public function configureOptions(OptionsResolver $resolver): void
  65.     {
  66.         $resolver->setDefaults([
  67.             // Configure your form options here
  68.         ]);
  69.     }
  70. }