Componette

Componette

Recaptcha

Recaptcha for Nette Framework 2.4+

Usage

NEON configuration

parameters:
    recaptcha:
        sitekey: ...
        secret: ...

Example

Add extension method:

/**
 * @param \Nette\Forms\Container
 * @param string
 * @param string
 * @param string
 * @return \App\UI\Forms\Controls\Recaptcha
 */
Container::extensionMethod('addRecaptcha', function (Container $form, $name = 'recaptcha', $caption = 'Recaptcha', $message = 'Recaptcha validation failed.') {
    return $form[$name] = new App\UI\Forms\Controls\Recaptcha($caption, $message);
});

Add input in form

$form = new Form($this, $name); // form must be attached to presenter
$form->addRecaptcha();

Latte template

{input recaptcha}

HTML

...
<script src="https://www.google.com/recaptcha/api.js"></script>
</body>
</html>

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

bar-chart-fill

Statistics

download-cloud-fill
N/A
star-fill
0
bug-fill
0
flashlight-fill
7.2y
price-tag-2-line

Badges

Componette Componette felix@nette.org