plugin eve-plugin-captcha
Google Captcha Plugin for the Eve Framework
eve-php/eve-plugin-captcha
Google Captcha Plugin for the Eve Framework
- Tuesday, November 10, 2015
- by cblanquera
- Repository
- 3 Watchers
- 0 Stars
- 0 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Google Captcha for the Eve Framework
====, (*1)
, (*2)
Install
composer install eve-php/eve-plugin-captcha
, (*3)
====, (*4)
, (*5)
Usage
- Add this in public/index.php towards the top of the bootstrap chain.
//CAPTCHA
->add(Eve\Plugin\Captcha\Setup::i()->import('KEY', 'SECRET', '1234567890'))
-
'KEY'
is the ID given by Google.
-
'1234567890'
is the SECRET given by Google.
-
'1234567890'
is the escape key you use when writing tests for pages using this plugin.
- For each route, determine whether a CSRF ID should be generated and/or checked as in
'/product/create' => array(
'method' => 'ALL',
'make_captcha' => true,
'check_captcha' => true,
'class' => '\\Eve\\App\\Front\\Action\\Product\\Create'
),
- In each form template add before the form tag
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="form-group captcha">
<label class="control-label">{{_ 'Are you a robot ?'}}</label>
<div>
<input type="hidden" name="captcha" value="{{item.captcha}}" />
<div class="g-recaptcha" data-sitekey="{{item.captcha}}"></div>
</div>
</div>
- Done ;)