<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Gregwar\CaptchaBundle\Type\CaptchaType;
use Symfony\Component\Form\FormBuilderInterface;
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\ResetType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class ContactType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('prenom', TextType::class, [
'label' => false,
'attr' => [
'class' => 'form-control form-contact',
'placeholder' => 'Prénom *'
]
])
->add('nom', TextType::class, [
'label' => false,
'attr' => [
'class' => 'form-control form-contact',
'placeholder' => 'Nom *'
]
])
->add('email', EmailType::class, [
'label' => false,
'attr' => [
'class' => 'form-control form-contact',
'placeholder' => 'E-mail *'
]
])
->add('telephone', TextType::class, [
'label' => false,
'attr' => [
'class' => 'form-control form-contact',
'placeholder' => 'Téléphone *'
]
])
// ->add('objet', TextType::class, [
// 'label' => false,
// 'attr' => [
// 'class' => 'form-control form-contact',
// 'placeholder' => 'Objet de la demande *'
// ]
// ])
// ->add('rappel', ChoiceType::class, [
// 'label' => false,
// 'placeholder' => 'Préférence de rappel',
// 'choices' => [
// 'Sans préférence' => 'Sans préférence',
// 'Le matin' => 'Le matin',
// 'L\'après-midi' => 'L\'après-midi',
// ],
// 'attr' => [
// 'class' => 'form-select form-contact select-color'
// ]
// ])
->add('message', TextareaType::class, [
'label' => false,
'attr' => [
'class' => 'form-control form-contact',
'rows' => 8,
'placeholder' => 'Message'
]
])
->add('captcha', CaptchaType::class, [
'label' => false,
'as_url' => true,
'reload' => true,
'length' => 6,
'attr' => [
'style' => 'width: 230px',
'class' => 'form-control d-block mx-auto',
]
])
->add('envoyer', SubmitType::class, [
'label' => 'ENVOYER',
'attr' => [
'class' => 'button-contact'
]
])
// ->add('annuler', ResetType::class, [
// 'attr' => [
// 'class' => 'btn btn-secondary'
// ]
// ]);
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}