Skip to content

Kévin Dunglas

Founder of Les-Tilleuls.coop (worker-owned cooperative). Creator of API Platform, FrankenPHP, Mercure.rocks, Vulcain.rocks and of some Symfony components.

Menu
  • Talks
  • Resume
  • Sponsor me
  • Contact
Menu

Add reCAPTCHA widgets to Symfony forms

Posted on January 5, 2009January 5, 2009 by Kévin Dunglas

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:

recaptcha:
  public_key:      <your public reCAPTCHA key>
  private_key:     <your private reCAPTCHA key>

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.

Related posts:

  1. Tag Suggestion for symfony
  2. Patch to use sfXssSafePlugin with symfony 1.2
  3. A new Facebook Connect plugin for symfony 1: kdDoctrineGuardFacebookConnectPlugin
  4. 6 plugins Symfony indispensables

12 thoughts on “Add reCAPTCHA widgets to Symfony forms”

  1. Oncle Tom says:
    January 5, 2009 at 1:54 am

    I wonder why you published another reCaptcha plugin? The other one is not good enough?
    You could host it on symfony plugins listing for a better visibility.

    Reply
  2. Kévin Dunglas says:
    January 5, 2009 at 2:04 am

    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.

    Reply
    1. Oncle Tom says:
      January 5, 2009 at 2:21 am

      OK I understand better.

      However I thought there was already something and I found a reCaptcha widget+validator in the sfFormExtraPlugin.

      Reply
      1. Kévin Dunglas says:
        January 5, 2009 at 2:44 am

        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.

        Reply
        1. denderello says:
          January 6, 2009 at 10:47 am

          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.

          Reply
  3. Gunt says:
    January 6, 2009 at 7:27 am

    Why the hell are you reinventing the wheel here??? There's already http://www.symfony-project.org/plugins/sfFormExtr…

    And if you're not happy with the existing one, provide a patch for it! That's opensource!

    Reply
    1. Kévin Dunglas says:
      January 6, 2009 at 9:42 am

      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 😉

      Reply
  4. John says:
    January 6, 2009 at 10:38 am

    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.

    Reply
  5. Kévin Dunglas says:
    January 7, 2009 at 8:35 am

    Arthur Koziel just mailed me he is OK to merge our plugins. I'll write the units tests next week to submit a patch to sfFormExtras and maybe it will be only one reCAPTCHA plugin soon.

    Reply
  6. marcus says:
    February 11, 2009 at 12:14 am

    Hi there,

    how is the merge going? I'm looking forward to see this in the actual symphony reposetory 🙂

    Reply
  7. Pingback: Symfony, Symfony Framework, Symfony Development, Symfony web applications | Symfony
  8. PB says:
    May 27, 2009 at 7:31 am

    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.

    Reply

Leave a ReplyCancel reply

Social

  • Bluesky
  • GitHub
  • LinkedIn
  • Mastodon
  • X
  • YouTube

Links

  • API Platform
  • FrankenPHP
  • Les-Tilleuls.coop
  • Mercure.rocks
  • Vulcain.rocks

Subscribe to this blog

Top Posts & Pages

  • Symfony's New Native Docker Support (Symfony World)
  • JSON Columns and Doctrine DBAL 3 Upgrade
  • Securely Access Private Git Repositories and Composer Packages in Docker Builds
  • Develop Faster With FrankenPHP
  • Preventing CORS Preflight Requests Using Content Negotiation
  • FrankenPHP: The Modern Php App Server, written in Go
  • Running Laravel Apps With FrankenPHP (Laracon EU)
  • Generate a Symfony password hash from the command line
  • How to debug Xdebug... or any other weird bug in PHP
  • 6x faster Docker builds for Symfony and API Platform projects

Tags

Apache API API Platform Buzz Caddy Docker Doctrine FrankenPHP Go Google GraphQL HTTP/2 Hydra hypermedia Hébergement Javascript JSON-LD Kubernetes La Coopérative des Tilleuls Les-Tilleuls.coop Lille Linux Mac Mercure Mercure.rocks Messagerie Instantanée MySQL performance PHP Punk Rock Python React REST Rock'n'Roll Schema.org Security SEO SEO Symfony Symfony Live Sécurité Ubuntu Web 2.0 webperf XML

Archives

Categories

  • DevOps (84)
    • Ubuntu (68)
  • Go (17)
  • JavaScript (46)
  • Mercure (7)
  • Opinions (91)
  • PHP (170)
    • API Platform (77)
    • FrankenPHP (9)
    • Laravel (1)
    • Symfony (97)
    • Wordpress (6)
  • Python (14)
  • Security (15)
  • SEO (25)
  • Talks (46)
© 2025 Kévin Dunglas | Powered by Minimalist Blog WordPress Theme