Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fetzi/kirby-uniform-recaptcha
Extension of the kirby-uniform plugin
https://github.com/fetzi/kirby-uniform-recaptcha
kirby kirby-plugin php recaptcha
Last synced: about 1 month ago
JSON representation
Extension of the kirby-uniform plugin
- Host: GitHub
- URL: https://github.com/fetzi/kirby-uniform-recaptcha
- Owner: fetzi
- License: mit
- Created: 2015-12-21T06:58:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-01-15T11:49:40.000Z (almost 6 years ago)
- Last Synced: 2024-05-01T15:48:21.407Z (7 months ago)
- Topics: kirby, kirby-plugin, php, recaptcha
- Language: PHP
- Size: 7.81 KB
- Stars: 13
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kirby-uniform-recaptcha
An extension to the Kirby 2 plugin [Uniform](https://github.com/mzur/kirby-uniform) (v3) to add the Google reCAPTCHA guard.
## Installation
### Kirby CLI
Get the [Kirby CLI](https://github.com/getkirby/cli) and run `kirby plugin:install fetzi/kirby-uniform-recaptcha`.
### Traditional
[Download](https://github.com/fetzi/kirby-uniform-recaptcha/archive/master.zip) the repository and extract it to `site/plugins/uniform-recaptcha`.
### Composer
Run `composer require fetzi/kirby-uniform-recaptcha`. Then add the second `require` to the `index.php` like this:
```php
// load kirby
require(__DIR__ . DS . 'kirby' . DS . 'bootstrap.php');
require 'vendor'.DS.'autoload.php';
```Be sure to include the new `vendor` directory in your deployment.
## Configuration
Define the mandatory config settings:
1. `c::set('uniform-recaptcha-sitekey', 'YOUR RECAPTCHA SITEKEY');`
2. `c::set('uniform-recaptcha-secret', 'YOUR RECAPTCHA SECRET');`## Usage
You can use the `recaptchaGuard` in your controllers form definition:
```php
$form = new Form(/* ... */);if (r::is('POST')) {
$form->recaptchaGuard()
->emailAction(/* ... */);
}
```To embed the recaptcha field into your template simply call
``The plugin needs the recaptcha Javascript File provided by Google. You can either include the [JavaScript file](https://www.google.com/recaptcha/api.js) directly into your page or by calling the method `embed_recaptcha_js()` in your template.
**Example**
```html+phpName
error('name')): ?> class="erroneous" name="name" type="text" value="old('name') ?>">
```
## Author
Johannes Pichler [https://johannespichler.com](https://johannespichler.com)