<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use VictorPrdh\RecaptchaBundle\Form\ReCaptchaType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class ContactType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('email', EmailType::class, [
'label' => false,
'attr' => [
'placeholder' => 'E-mail'
]
])
->add('lastname', TextType::class, [
'label' => false,
'attr' => [
'placeholder' => 'Nom'
]
])
->add('firstname', TextType::class, [
'label' => false,
'attr' => [
'placeholder' => 'Prénom'
]
])
->add('fonction', ChoiceType::class, [
'label' => false,
'choices' => [
'Votre fonction' => null,
'Aménageur' => 'aménageur',
'Constructeur' => 'constructeur',
'Instructeur' => 'instructeur',
'Maître d\'oeuvres' => 'mo',
'Pétitionnaire' => 'pétitionnaire',
'Autre' => 'autre',
],
'attr' => [
'placeholder' => 'Votre fonction'
]
])
->add('content', TextareaType::class, [
'label' => false,
'attr' => [
'placeholder' => 'Votre message'
]
])
->add('captcha', ReCaptchaType::class)
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}