src/Form/Type/AskMailType.php line 16

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 AskMailType 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' => '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('number'TelType::class, [
  29.                  'attr' => ['class' => 'form-control' 'placeholder' => 'Téléphone'],
  30.                 'row_attr' => ['class' => 'form-group'],
  31.                 'label' => false,
  32.                 ])
  33.             ->add('message'TextareaType::class, [
  34.                 'attr' => ['class' => 'form-control' 'placeholder' => 'Message'],
  35.                 'row_attr' => ['class' => 'form-group'],
  36.                 'label' => false,
  37.             ])
  38.             ->add('recaptchatoken'HiddenType::class, [
  39.                 'required' => false,
  40.                 'mapped' => false,
  41.             ])
  42.             ->add('search'SubmitType::class, [
  43.                 'attr' => ['class' => 'btn btn-block btn-primary mt-4'],
  44.                 'label' => 'Envoyer' ])
  45.         ;
  46.     }
  47.     public function configureOptions(OptionsResolver $resolver)
  48.     {
  49.         $resolver->setDefaults([
  50.             // Configure your form options here
  51.         ]);
  52.     }
  53. }