Skip to content

Instantly share code, notes, and snippets.

@yevgenko
Created April 17, 2010 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yevgenko/369216 to your computer and use it in GitHub Desktop.
Save yevgenko/369216 to your computer and use it in GitHub Desktop.
<?php
class sfWidgetFormReCaptcha2 extends sfWidgetFormReCaptcha
{
/**
* @see sfWidgetFormReCaptcha
*/
public function render($name, $value = null, $attributes = array(), $errors = array())
{
$server = $this->getServerUrl();
$key = $this->getOption('public_key');
return sprintf('
<div id="recaptcha_div"></div>
<script type="text/javascript">
Recaptcha.create("%s",
"recaptcha_div", {
theme: "red",
callback: Recaptcha.focus_response_field
});
</script>
<noscript>
<iframe src="%s/noscript?k=%s" height="300" width="500" frameborder="0"></iframe><br />
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge" />
</noscript>
', $key, $server, $key);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment