2017 © Pedro Peláez
 

symfony-bundle recaptcha-bundle

This bundle provides easy integration of Recaptcha into symfony2

image

acrobat/recaptcha-bundle

This bundle provides easy integration of Recaptcha into symfony2

  • Sunday, August 7, 2016
  • by acrobat
  • Repository
  • 3 Watchers
  • 4 Stars
  • 2,560 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

AcrobatRecaptchaBundle

SensioLabsInsight Build Status Latest Stable Version Latest Unstable Version License, (*1)

This bundle provides reCAPTCHA integration with symfony2 forms., (*2)

Installation

Step 1: Use composer and enable Bundle

To install AcrobatRecaptchaBundle with composer just run the following command:, (*3)

Symfony 2.3 installation

$ php composer.phar require acrobat/recaptcha-bundle:~1.0

Symfony >= 2.4 installation

$ php composer.phar require acrobat/recaptcha-bundle:~2.0

Note: In RecaptchaBundle 2.0 we dropped support for symfony 2.3, see issue #4. Both versions 1.0 and 2.0 will be maintained., (*4)

This will add the config line to the composer.json and installs the latest stable version of this bundle., (*5)

All that is left to do is to update your AppKernel.php file, and register the new bundle:, (*6)

<?php

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Acrobat\Bundle\RecaptchaBundle\AcrobatRecaptchaBundle(),
    // ...
);

Step2: Configure the bundle's

Your reCAPTCHA's public and private keys that can be found at your recaptcha admin page. Add the following to your config.yml:, (*7)

``` yaml, (*8)

app/config/config.yml

acrobat_recaptcha: public_key: here_is_your_public_key private_key: here_is_your_private_key locale: %kernel.default_locale%, (*9)


**Note**: Only public_key and private_key are required other settings will use the default values when they are not defined. You can disable reCAPTCHA (for example in a local or test environment): ``` yaml # app/config/config.yml acrobat_recaptcha: // ... enabled: false

Load reCAPTCHA using Ajax:, (*10)

``` yaml, (*11)

app/config/config.yml

acrobat_recaptcha: // ... ajax: true, (*12)


Use https for recaptcha connections ``` yaml # app/config/config.yml acrobat_recaptcha: // ... https: auto

Possible values: - on : always use https - off : always use http - auto : let the browser decide what protocol to use, based on the original request protocol (default), (*13)

Basic Usage

Usage in forms

Add the following line to create the reCAPTCHA field:, (*14)

``` php <?php, (*15)

public function buildForm(FormBuilder $builder, array $options) { // ... $builder->add('recaptcha', 'recaptcha'); }, (*16)


You can pass extra options to reCAPTCHA with the options attribute: ``` php <?php public function buildForm(FormBuilder $builder, array $options) { // ... $builder->add('recaptcha', 'recaptcha', array( 'attr' => array( 'options' => array( 'theme' => 'clean' ) ) )); // ... }

List of valid options: * theme * lang * custom_translations * custom_theme_widget * tabindex, (*17)

Visit Customizing the Look and Feel of reCAPTCHA for the details of customization., (*18)

Validation

RecaptchaType has a built-in validator, you don't need to setup anything!, (*19)

You can disable the default validation by removing the existing validator in the form config:, (*20)

``` php <?php, (*21)

public function buildForm(FormBuilder $builder, array $options) { // ... $builder->add('recaptcha', 'recaptcha', array( // only for disabling validation 'constraints' => array() )); } ```, (*22)

The Versions

07/08 2016

dev-master

9999999-dev

This bundle provides easy integration of Recaptcha into symfony2

  Sources   Download

MIT

The Requires

 

by Jeroen Thora

07/08 2016

dev-recaptcha-v2

dev-recaptcha-v2

This bundle provides easy integration of Recaptcha into symfony2

  Sources   Download

MIT

The Requires

 

by Jeroen Thora

04/12 2015

1.0.x-dev

1.0.9999999.9999999-dev

This bundle provides easy integration of Recaptcha into symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jeroen Thora

19/10 2014

v2.0.0

2.0.0.0

This bundle provides easy integration of Recaptcha into symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jeroen Thora

19/10 2014

v1.0.0

1.0.0.0

This bundle provides easy integration of Recaptcha into symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jeroen Thora

18/10 2014

v0.1.0

0.1.0.0

This bundle provides easy integration of Recaptcha into symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jeroen Thora