<?php
namespace App\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TelType;
class AskMailType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', TextType::class, [
'attr' => ['class' => 'form-control', 'placeholder' => 'Nom'],
'row_attr' => ['class' => 'form-group'],
'label' =>false
])
->add('email', EmailType::class, [
'attr' => ['class' => 'form-control', 'placeholder' => 'Email'],
'row_attr' => ['class' => 'form-group'],
'label' => false,
])
->add('number', TelType::class, [
'attr' => ['class' => 'form-control' , 'placeholder' => 'Téléphone'],
'row_attr' => ['class' => 'form-group'],
'label' => false,
])
->add('message', TextareaType::class, [
'attr' => ['class' => 'form-control' , 'placeholder' => 'Message'],
'row_attr' => ['class' => 'form-group'],
'label' => false,
])
->add('recaptchatoken', HiddenType::class, [
'required' => false,
'mapped' => false,
])
->add('search', SubmitType::class, [
'attr' => ['class' => 'btn btn-block btn-primary mt-4'],
'label' => 'Envoyer' ])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}