Skip to content

A PHP ZendFramework 2.0 (ZF2) - Google ReCAPTCHA Adapter

License

Notifications You must be signed in to change notification settings

GoPlan/recaptcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

recaptcha

A PHP ZF2 - ReCAPTCHA Adapter (Google)

This recaptcha class is used as an adapter to ZF2 default CAPTCHA form element. It provides both form validation and element view rendering.

Two major inputs are a public key and a private key. The public key is the site key, while the private key is the secret. Both keys are acquired from Google.

An example code is as below:

        $reCaptcha = new CDReCaptcha(); // This recaptcha class (CDReCaptcha is an alias to ReCaptcha)
        $reCaptcha->setPublicKey($publicKey);
        $reCaptcha->setPrivateKey($privateKey);
        $captchaElement = new Captcha('g-recaptcha-response');
        $captchaElement->setCaptcha($reCaptcha);

(The $captchaElement is then added to a form object)

If you need assistance or further improvement of this package, feel free to email me at ducanh.ke@gmail.com

About

A PHP ZendFramework 2.0 (ZF2) - Google ReCAPTCHA Adapter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages