New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

adair-creative/recaptcha

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adair-creative/recaptcha

Tools for quick Google ReCAPTCHA implementation

Source
Packagist
Version
1.7
Version published
Total downloads
287
Maintainers
1
Created
Source

SilverStripe Easy ReCAPTCHA

About

Allows for easy and quick implementation of the Google ReCAPTCHA v2.0

Installation

composer require adair-creative/recaptcha

Guide

config.yml

AdairCreative\ReCAPTCHA:
    secret_key: [your-secret-key]
    app_key: [your-public-app-key]

PageController.php

protected function init() {
	...
	ReCAPTCHA::importJavascript();
	ReCAPTCHA::importCSS();
	...
}

YourForm.php

public function __construct(ContentController $controller, string $name) {
	$fields = new FieldList([
		TextField::create("Message", "")
	]);

	ReCAPTCHA::addField($fields);

	return parent::__construct(
		$controller,
		$name,
		$fields,
		new FieldList([]),
		new FieldList([
		"Message"
		])
	);
}

FAQs

Package last updated on 17 Sep 2021

Related posts