Statistics
4458
14
0
7d
Badges
Requirements

reCAPTCHA for Nette Framework

Installation

composer require uestla/recaptcha-control

For frontend javascript that activates reCAPTCHA(s), use

bower install

Or just load the javascript file in assets/recaptcha.js by hand. It also loads Google's recaptcha library itself.

Usage

config.neon

extensions:
	reCaptcha: ReCaptchaControl\DI\Extension

reCaptcha:
	siteKey: '<your_site_key>'
	secretKey: '<your_secret_key>'
	methodName: 'addReCaptcha' # optional

Form

$form->addReCaptcha('captcha', NULL, "Please prove you're not a robot.");

NOTE: The validation rule is set automatically so no addRule() is required here.

Template

To render the reCAPTCHA element manually in Latte simply use

<form ...>
	<div n:name="captcha"></div>

	{* or *}

	{input captcha}
</form>

And that's it!

No release at this moment. Try to create first one.

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette admin@componette.com