src/Form/ContactType.php line 16
<?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('nom', TextType::class, [
'label' => false,
'attr' => [
'class' => 'form-control form-contact',
'placeholder' => 'Votre nom *',
'style' => 'font-size: 0.9rem;'
]
])
->add('prenom', TextType::class, [
'label' => false,
'attr' => [
'class' => 'form-control form-contact',
'placeholder' => 'Votre prénom *',
'style' => 'font-size: 0.9rem;'
]
])
->add('telephone', TextType::class, [
'label' => false,
'required' => false,
'attr' => [
'class' => 'form-control form-contact',
'placeholder' => 'Votre numéro de téléphone',
'style' => 'font-size: 0.9rem;'
]
])
->add('email', EmailType::class, [
'label' => false,
'required' => false,
'attr' => [
'class' => 'form-control form-contact',
'placeholder' => 'Votre email *',
'style' => 'font-size: 0.9rem;'
]
])
->add('sujet', TextType::class, [
'label' => false,
'attr' => [
'class' => 'form-control form-contact',
'placeholder' => 'Objet de votre demande *',
'style' => 'font-size: 0.9rem;'
]
])
->add('message', TextareaType::class, [
'label' => false,
'attr' => [
'class' => 'form-control form-contact',
'rows' => 8,
'placeholder' => 'Message *',
'style' => 'font-size: 0.9rem;'
]
])
->add('captcha', CaptchaType::class, [
'label' => false,
'length' => 6,
'width' => 200,
'height' => 45,
// 'as_url' => true,
// 'reload' => true,
'attr' => [
'style' => 'width: 200px',
'class' => 'form-control'
]
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}