src/Form/ContactType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  5. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  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 ContactType extends AbstractType
  11. {
  12.     public function buildForm(FormBuilderInterface $builder, array $options): void
  13.     {
  14.         $builder
  15.             ->add('firstname'TextType::class, [
  16.                 'label'=> false,
  17.                 'attr' => [
  18.                     'placeholder' => 'Prenom',
  19.                     'class'             =>  'form-control border-0 bg-light px-4',
  20.                     'style'         =>'height: 55px'
  21.                 ]
  22.             ])
  23.             ->add('lastname'TextType::class, [
  24.                 'label'=> false,
  25.                 'attr' => [
  26.                     'placeholder' => 'Nom',
  27.                     'class'             =>  'form-control border-0 bg-light px-4',
  28.                     'style'         =>'height: 55px'
  29.                 ]
  30.             ])
  31.             ->add('email'EmailType::class, [
  32.                 'label'=> false,
  33.                 'attr' => [
  34.                     'placeholder' => 'Email',
  35.                     'class'             =>  'form-control border-0 bg-light px-4',
  36.                     'style'         =>'height: 55px'
  37.                 ]
  38.             ])
  39.             ->add('content'TextareaType::class, [
  40.                 'label'=> false,
  41.                 'attr' => [
  42.                     'placeholder' => 'Message',
  43.                     'class'             =>  'form-control border-0 bg-light px-4',
  44.                     'style'         =>'height: 55px'
  45.                 ]
  46.             ])
  47.             ->add('submit'SubmitType::class, [
  48.                 'label' => 'Envoyer',
  49.                 'attr' => [
  50.                     'class' => 'btn btn-primary py-2 px-4'
  51.                 ]
  52.             ])
  53.         ;
  54.     }
  55.     public function configureOptions(OptionsResolver $resolver): void
  56.     {
  57.         $resolver->setDefaults([
  58.             // Configure your form options here
  59.         ]);
  60.     }
  61. }