whatson-web/recaptcha-bundle

Symfony - Whatson Web - RecaptchaBundle

dev-master 2018-10-03 08:18 UTC

This package is not auto-updated.

Last update: 2024-04-14 21:02:04 UTC


README

Bundle

JS

Insérez la librairie Google avec la balise :

<script src='https://www.google.com/recaptcha/api.js'></script>

Config

wh_recaptcha:
    public_key: ''
    private_key: ''

Mise en place sur un formulaire

FormType

Ajouter un champ dans le formulaire, ex :

->add(
    'recaptcha',
    RecaptchaType::class
)

Thème

Appliquer le thème au formulaire :

{% form_theme form with ['my_base.html.twig', 'WHRecaptchaBundle:Form:fields.html.twig'] %}