<?php
declare(strict_types=1);
/*
* Copyright (C) Office National de Publication et de Communication - All Rights Reserved
*
* Unauthorized copying of this file, via any medium is strictly prohibited by law
* This file is proprietary and confidential
*/
namespace App\Form;
use App\Entity\FicheProspect;
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;
final class FicheProspectType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('nom')
->add('adresse')
->add('codePostal')
->add('ville')
->add('telephone')
->add('email')
/* Honeypot : */
->add('email2', TextType::class,
[
'required' => false,
'mapped' => false,
'label' => false,
'attr' => [
'style' => 'display:none !important',
'tabindex' => '-1',
'autocomplete' => 'off',
],
])
->add('siteWeb')
->add('responsable')
->add('categorie')
->add('description')
->add('captcha', CaptchaType::class, [
'mapped' => false,
'width' => 150,
'height' => 60,
'length' => 4,
'invalid_message' => 'Merci de saisir le bon code anti-robot !',
'distortion' => false,
'background_color' => [255, 255, 255]
])
->add('autoriseContact');
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => FicheProspect::class,
]);
}
}