src/Form/contactMailType.php line 19

Open in your IDE?
  1. <?php
  2. /*
  3. * Ce fichier est la propriété de l'association (c) Projets Métiers
  4. *
  5. * (c) crée par Jean-Marc CATALA <jeanmmarccatala@gmail.com>
  6. *
  7. */
  8. namespace App\Form;
  9. use Symfony\Component\Form\AbstractType;
  10. use Symfony\Component\Form\FormBuilderInterface;
  11. use Symfony\Component\OptionsResolver\OptionsResolver;
  12. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  13. use Symfony\Component\Form\Extension\Core\Type\TextType;
  14. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  15. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  16. class contactMailType extends AbstractType
  17. {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function buildForm(FormBuilderInterface $builder, array $options)
  22. {
  23. $builder->add('nom', TextType::class, array('label' => 'Nom :'))
  24. ->add('prenom', TextType::class, array('label' => 'Prénom :'))
  25. ->add('courriel', EmailType::class, array('label' => 'Courriel (Email) :'))
  26. ->add('sujet', TextareaType::class, array('label' => 'Sujet :',
  27. 'attr' => array( 'placeholder' => 'Entrez votre message ou votre demande')))
  28. ->add('save', SubmitType::class, array('label' => 'ENVOYER'));
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function configureOptions(OptionsResolver $resolver)
  34. {
  35. $resolver->setDefaults(array(
  36. 'data_class' => 'App\Entity\contactMail'
  37. ));
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. public function getBlockPrefix()
  43. {
  44. return 'app_userbundle_contactmail';
  45. }
  46. }