2017 © Pedro Peláez
 

library zf1-recaptcha-2

A quick package to assist with using Google reCAPTCHA version 2 with ZF1 (php 5.3.27)

image

wendrowycz/zf1-recaptcha-2

A quick package to assist with using Google reCAPTCHA version 2 with ZF1 (php 5.3.27)

  • Friday, May 5, 2017
  • by wendrowycz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 777 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 12 Forks
  • 0 Open issues
  • 9 Versions
  • 3 % Grown

The README.md

ZF1 reCAPTCHA2 - Google reCAPTCHA integration

ZF1 ships with Google reCAPTCHA version 1. Now that version 2 is available you will probably want to use an up-to-date element for your Zend Framework installations., (*1)

Installation

Composer Install

"require": {
    "wendrowycz/zf1-recaptcha-2": "~1.0"
}

Usage

Install the latest version (1.0.1) and setup your plugins and form abstract with the following information:, (*2)

  • On your application.ini or where you want
recaptcha.sitekey = "YOUR SITE KEY GIVED BY GOOGLE"
recaptcha.secretkey = "YOUR SECRET KEY GIVED BY GOOGLE"
  • In your controller:
<?php
$this->view->headScript()->appendFile('//www.google.com/recaptcha/api.js'); 
$this->view->addHelperPath(APPLICATION_PATH . 'Wendrowycz', 'Wendrowycz');
  • In the init() function of your Form
 $this->addPrefixPath('Wendrowycz\\Form\\Element', APPLICATION_PATH . '/../vendor/wendrowycz/zf1-recaptcha-2/src/Wendrowycz/Form/Element', Zend_Form::ELEMENT);
 $this->addElementPrefixPath('Wendrowycz\\Validate\\', APPLICATION_PATH . '/../vendor/wendrowycz/zf1-recaptcha-2/src/Wendrowycz/Validate/', Zend_Form_Element::VALIDATE);

  • Below is what you would setup in your form.
<?php

// create your element and pass through your site key and secret key
$this->addElement('Recaptcha', 'g-recaptcha-response', [
    'siteKey'   => Zend_Registry::get('application')->recaptcha->sitekey,
    'secretKey' => Zend_Registry::get('application')->recaptcha->secretkey,
]);

  • On your controller, after "validate the post data"
if($form->isValid($_POST)) {
    $values = $form->getValues();
    unset($values['g-recaptcha-response']);
    // Your business logic must be here
}

About

Requirements

  • ZF1 reCAPTCHA2 works with PHP 5.5 or above.

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub, (*3)

Author

Chris Smith - chris@cgsmith.net - http://twitter.com/cgsmith105, (*4)

License

ZF1 reCAPTCHA2 is licensed under the MIT License - see the LICENSE file for details, (*5)

The Versions

05/05 2017

dev-master

9999999-dev

A quick package to assist with using Google reCAPTCHA version 2 with ZF1 (php 5.3.27)

  Sources   Download

MIT

The Requires

 

zf1 zend google recaptcha

05/05 2017

1.0.5

1.0.5.0

A quick package to assist with using Google reCAPTCHA version 2 with ZF1 (php 5.3.27)

  Sources   Download

MIT

The Requires

 

zf1 zend google recaptcha

13/07 2016

1.0.4

1.0.4.0

A quick package to assist with using Google reCAPTCHA version 2 with ZF1 (php 5.3.27)

  Sources   Download

MIT

The Requires

 

zf1 zend google recaptcha

13/07 2016

1.0.3

1.0.3.0

A quick package to assist with using Google reCAPTCHA version 2 with ZF1 (php 5.3.27)

  Sources   Download

MIT

The Requires

 

zf1 zend google recaptcha

26/04 2016

1.0.2

1.0.2.0

A quick package to assist with using Google reCAPTCHA version 2 with ZF1

  Sources   Download

MIT

The Requires

 

zf1 zend google recaptcha

26/04 2016

dev-bugfix/adding-correct-namespacing

dev-bugfix/adding-correct-namespacing

A quick package to assist with using Google reCAPTCHA version 2 with ZF1

  Sources   Download

MIT

The Requires

 

zf1 zend google recaptcha

15/04 2015

1.0.1

1.0.1.0

A quick package to assist with using Google reCAPTCHA version 2 with ZF1

  Sources   Download

MIT

The Requires

 

zf1 zend google recaptcha

31/03 2015

dev-zf1-recaptcha-2-1

dev-zf1-recaptcha-2-1

A quick package to assist with using Google reCAPTCHA version 2 with ZF1

  Sources   Download

MIT

The Requires

 

zf1 zend recaptcha

31/03 2015

1.0.0

1.0.0.0

A quick package to assist with using Google reCAPTCHA version 2 with ZF1

  Sources   Download

MIT

The Requires

 

zf1 zend recaptcha