Author: garak
Date: 2010-04-07 14:52:39 +0200 (Wed, 07 Apr 2010)
New Revision: 29031

Modified:
   plugins/sfReCaptchaPlugin/branches/1.3/README
   
plugins/sfReCaptchaPlugin/branches/1.3/modules/recaptcha/actions/actions.class.php
Log:
[sfReCaptchaPlugin] improved README


Modified: plugins/sfReCaptchaPlugin/branches/1.3/README
===================================================================
--- plugins/sfReCaptchaPlugin/branches/1.3/README       2010-04-07 12:36:06 UTC 
(rev 29030)
+++ plugins/sfReCaptchaPlugin/branches/1.3/README       2010-04-07 12:52:39 UTC 
(rev 29031)
@@ -95,6 +95,24 @@
       $this->validatorSchema->setOption('filter_extra_fields', false);
     }
 
+The following code in your action:
+
+    [php]
+    if ($request->isMethod(sfRequest::POST))
+    {
+      $requestData = $request->getParameter($this->form->getName());
+      if (sfConfig::get('app_recaptcha_active', false))
+      {
+        $requestData['challenge'] = 
$this->getRequestParameter('recaptcha_challenge_field');
+        $requestData['response'] = 
$this->getRequestParameter('recaptcha_response_field');
+      }
+      $this->form->bind($requestData);
+      if ($this->form->isValid())
+      {
+        // ...
+      }
+    }
+
 And the following code in your template:
 
     [php]
@@ -104,4 +122,11 @@
     <?php echo recaptcha_get_html(sfConfig::get('app_recaptcha_publickey'), 
$form['response']->getError()) ?>
     <?php endif ?>
 
-So, you can safely test your forms, without worrying about CAPTCHAs.
\ No newline at end of file
+So, you can safely test your forms, without worrying about CAPTCHAs.
+
+If you need an output compliant with XHTML strict, you can pass an optional
+ 4th parameter to `recaptcha_get_html()`, that forces use of `object` tag
+instead of the unsupported `iframe`:
+
+    [php]
+    <?php echo recaptcha_get_html(sfConfig::get('app_recaptcha_publickey'), 
$form['response']->getError(), false, true) ?>

Modified: 
plugins/sfReCaptchaPlugin/branches/1.3/modules/recaptcha/actions/actions.class.php
===================================================================
--- 
plugins/sfReCaptchaPlugin/branches/1.3/modules/recaptcha/actions/actions.class.php
  2010-04-07 12:36:06 UTC (rev 29030)
+++ 
plugins/sfReCaptchaPlugin/branches/1.3/modules/recaptcha/actions/actions.class.php
  2010-04-07 12:52:39 UTC (rev 29031)
@@ -14,7 +14,7 @@
   {
     $this->form = new reCaptchaForm();
 
-    if ($request->isMethod(sfWebRequest::POST))
+    if ($request->isMethod(sfRequest::POST))
     {  
       $requestData = array(
         'challenge' => $this->getRequestParameter('recaptcha_challenge_field'),

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to