src/Form/ContactType.php line 12

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\TextareaType;
  6. use Symfony\Component\Form\Extension\Core\Type\TextType;
  7. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  8. use Symfony\Component\Form\FormBuilderInterface;
  9. class ContactType extends AbstractType
  10. {
  11. public function buildForm(FormBuilderInterface $builder, array $options)
  12. {
  13. $builder
  14. ->add('name', TextType::class, [
  15. 'label' => 'Nom',
  16. 'attr' => ['placeholder' => 'Entrez votre nom complet'],
  17. ])
  18. ->add('email', EmailType::class, [
  19. 'label' => 'Email',
  20. 'attr' => ['placeholder' => 'Entrez votre adresse email'],
  21. ])
  22. ->add('subject', TextType::class, [
  23. 'label' => 'Objet',
  24. 'attr' => ['placeholder' => 'Entrez l\'objet'],
  25. ])
  26. ->add('message', TextareaType::class, [
  27. 'label' => 'Message',
  28. 'attr' => ['placeholder' => 'Tapez votre message ici...',
  29. 'rows' => 7, // Nombre de lignes visibles du textarea
  30. ],
  31. ])
  32. ;
  33. }
  34. }