Browse Source

[Frontend] Contact : ajout captcha

develop
Guillaume 3 years ago
parent
commit
c0e3ad6a36
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      ShopBundle/Form/Frontend/TicketType.php

+ 4
- 5
ShopBundle/Form/Frontend/TicketType.php View File

@@ -23,6 +23,7 @@ class TicketType extends AbstractType
protected $security ;
protected $em ;
protected $priceUtils ;
protected $utils ;

public function __construct(Security $security, EntityManagerInterface $em, UtilsManager $utilsManager)
{
@@ -30,6 +31,7 @@ class TicketType extends AbstractType
$this->em = $em ;
$this->orderShopRepository = $this->em->getRepository(OrderShop::class) ;
$this->priceUtils = $utilsManager->getPriceUtils() ;
$this->utils = $utilsManager->getUtils() ;
}

public function buildForm(FormBuilderInterface $builder, array $options)
@@ -83,11 +85,8 @@ class TicketType extends AbstractType
]) ;
}
else {
// captcha (honey pot)
$builder->add('body', TextType::class, [
'label' => 'Body',
'required' => false,
]) ;
// captcha
$this->utils->addCaptchaType($builder);
}

$builder->add('subject', TextType::class, [

Loading…
Cancel
Save