src/Form/ContactType.php line 18
<?phpnamespace App\Form;use App\Entity\Contact;use App\Entity\Pole;use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaV3Type;use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrueV3;use Symfony\Bridge\Doctrine\Form\Type\EntityType;use Symfony\Component\Form\AbstractType;use Symfony\Component\Form\Extension\Core\Type\CheckboxType;use Symfony\Component\Form\Extension\Core\Type\EmailType;use Symfony\Component\Form\Extension\Core\Type\TextareaType;use Symfony\Component\Form\Extension\Core\Type\TextType;use Symfony\Component\Form\FormBuilderInterface;use Symfony\Component\OptionsResolver\OptionsResolver;class ContactType extends AbstractType{public function buildForm(FormBuilderInterface $builder, array $options): void{$builder->add('lastname', TextType::class, ['label' => 'Nom','required' => true,])->add('firstname', TextType::class, ['label' => 'Prénom','required' => true,])->add('telephone', TextType::class, ['label' => 'Téléphone','required' => true,])->add('email', EmailType::class, ['label' => 'Email','required' => true,])->add('postalCode', TextType::class, ['label' => 'Code postal','required' => true,])->add('society', TextType::class, ['label' => 'Société','required' => true,])->add('message', TextareaType::class, ['label' => 'Message','required' => true,])->add('pole', EntityType::class, ['label' => 'Pôle','required' => true,'class' => Pole::class,'choice_label' => 'name',])->add('legalTerms', CheckboxType::class, ['label' => 'En cochant cette case, j\'accepte la politique de confidentialité','required' => true,])->add('recaptcha', EWZRecaptchaV3Type::class, ['action_name' => 'contact','constraints' => [new IsTrueV3(),],'attr' => ['theme' => 'light','type' => 'image','size' => 'invisible', // set size to invisible'defer' => true,'async' => true,'callback' => 'onReCaptchaSuccess', // callback will be set by default if not defined (along with JS function that validate the form on success)'bind' => 'btn_submit', // this is the id of the form submit button],]);}public function configureOptions(OptionsResolver $resolver): void{$resolver->setDefaults(['data_class' => Contact::class,]);}}