src/Form/Type/ContactType.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Form\Type;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\FormBuilderInterface;
  5. use Symfony\Component\Form\Extension\Core\Type as FormType;
  6. use Symfony\Component\OptionsResolver\OptionsResolver;
  7. class ContactType extends AbstractType
  8. {
  9. /** {@inheritdoc} */
  10. public function buildForm(FormBuilderInterface $oBuilder, array $aOptions)
  11. {
  12. $oBuilder
  13. ->add('reference', FormType\TextType::class, array(
  14. 'attr' => array(
  15. 'placeholder' => 'Référence bien',
  16. 'class' => 'text-uppercase'
  17. ),
  18. 'label' => false,
  19. 'required' => false,
  20. ))
  21. ->add('name', FormType\TextType::class, array(
  22. 'attr' => array(
  23. 'placeholder' => 'Nom',
  24. 'class' => 'text-uppercase'
  25. ),
  26. 'label' => false,
  27. ))
  28. ->add('email', FormType\EmailType::class, array(
  29. 'attr' => array('placeholder' => 'Email'),
  30. 'label' => false
  31. ))
  32. ->add('phone', FormType\TelType::class, array(
  33. 'attr' => array('placeholder' => 'Téléphone'),
  34. 'label' => false
  35. ))
  36. ->add('content', FormType\TextareaType::class, array(
  37. 'attr' => array(
  38. 'placeholder' => 'Message',
  39. 'rows' => 8,
  40. ),
  41. 'label' => false,
  42. 'required' => true,
  43. ))
  44. ;
  45. }
  46. /** {@inheritdoc} */
  47. public function configureOptions(OptionsResolver $oResolver)
  48. {
  49. $oResolver->setDefaults(array(
  50. 'translation_domain' => false,
  51. 'contract' => null,
  52. ));
  53. }
  54. }