Add reCAPTCHA widgets to Symfony forms

I’ve wrote a new Symfony plugin to add reCAPTCHA widgets and validation to Symfony new forms. reCAPTCHA is a free CAPTCHA service that helps to digitize books, newspapers and old time radio shows.

To install: checkout it from http://selfpublish.googlecode.com/svn/trunk/plugins/sfAnotherReCaptchaPlugin/ and put it in your Symfony plugins directory.

Next, get a reCAPTCHA key and put the following lines in your app.yml:

Clear the cache with the symfony cc and check that the plugin activated in projectConfiguration.class.php.
You are now able to add reCAPTCHA widgets and validators.

See the plugin’s README file or this register form with reCAPTCHA enabled to learn how to use it.

This plugin is distributed under the MIT license and is based on Arthur Koziel work.

12 comments

  1. The other plugin does not provide a reCAPTCHA form widget. I think my plugin is proper and easier, more in the Symfony new form spirit.
    With my plugin you can add a reCAPTCHA field to your form like any other field, without trick.

    I will host it on Symfony plugins listing but I'm waiting for a response of Arthur Koziel to merge our plugins.

      • Unlike this plugin, mine support both internal reCAPTCHA widget error display system (beautiful) and Symfony form error system.
        It relies on the official reCAPTCHA PHP implementation (this a custom implementation for sfFormExtraPlugin) and provides a MailHide helper.

        • maybe you cold contribute your code to the sfFormExtraPlugin as it sounds like you added some extra goodness to what already exists in sfFormExtraPlugin. This would make it easier for other developers to use your code since no other plugins than sfFormExtraPlugin would then be needed.

    • I've done my own implementation and explained the differences
      previously. This plugin is part of a bigger project: SelfPublish, a self-managed open source CMS I'm writing using Symfony. Maybe some people are looking for a reCAPTCHA plugin with features like mine, it's why I share it.

      I've already submitted a request to the
      sfRecaptchaPlugin owner and I'll send a patch for sfFormExtras but I
      need to add/modify units tests before! It's why I haven't listed my
      plugin in the Symfony plugins listing.

      Like you say, it's open source, you can modify it, or submit a patch yourself if you want 😉

  2. why do we need Symfony when there's plenty of other frameworks? cos we sometimes want slightly different things!

    Look forward to seeing your CMS.

  3. maybe you cold contribute your code to the sfFormExtraPlugin as it sounds like you added some extra goodness to what already exists in sfFormExtraPlugin. This would make it easier for other developers to use your code since no other plugins than sfFormExtraPlugin would then be needed.

Leave a Reply