<?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 ContactType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', TextType::class, [
'attr' => ['class' => 'form-control', 'placeholder' => 'Votre 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('message', TextareaType::class, [
'attr' => ['class' => 'form-control' , 'placeholder' => 'Comment pouvons nous vous aider?'],
'row_attr' => ['class' => 'form-group'],
'label' => false,
])
->add('recaptchatoken', HiddenType::class, [
'required' => false,
'mapped' => false,
])
->add('btnsubmit', SubmitType::class, [
'attr' => ['class' => 'btn btn-primary animate-up-2'],
'label' => 'Envoyer le message',
])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}