src/Form/Type/ContactType.php line 17

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\OptionsResolver\OptionsResolver;
  6. use Symfony\Component\Form\Extension\Core\Type\DateType;
  7. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  8. use Symfony\Component\Form\Extension\Core\Type\TextType;
  9. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  10. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  11. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  12. use Symfony\Component\Form\Extension\Core\Type\TelType;
  13. class ContactType extends AbstractType
  14. {
  15.     public function buildForm(FormBuilderInterface $builder, array $options)
  16.     {
  17.         $builder
  18.             ->add('name'TextType::class, [
  19.                 'attr' => ['class' => 'form-control''placeholder' => 'Votre nom'],
  20.                 'row_attr' => ['class' => 'form-group'],
  21.                 'label' =>false
  22.             ])
  23.             ->add('email'EmailType::class, [
  24.                 'attr' => ['class' => 'form-control''placeholder' => 'Email'],
  25.                 'row_attr' => ['class' => 'form-group'],
  26.                 'label' => false,
  27.             ])
  28.             ->add('message'TextareaType::class, [
  29.                 'attr' => ['class' => 'form-control' 'placeholder' => 'Comment pouvons nous vous aider?'],
  30.                 'row_attr' => ['class' => 'form-group'],
  31.                 'label' => false,
  32.             ])
  33.             ->add('recaptchatoken'HiddenType::class, [
  34.                 'required' => false,
  35.                 'mapped' => false,
  36.             ])
  37.             ->add('btnsubmit'SubmitType::class, [
  38.                 'attr' => ['class' => 'btn btn-primary animate-up-2'],
  39.                 'label' => 'Envoyer le message',
  40.             ])
  41.         ;
  42.     }
  43.     public function configureOptions(OptionsResolver $resolver)
  44.     {
  45.         $resolver->setDefaults([
  46.             // Configure your form options here
  47.         ]);
  48.     }
  49. }