Download the PHP package mikemix/mxrecaptcha without Composer
On this page you can find all versions of the php package mikemix/mxrecaptcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mikemix/mxrecaptcha
More information about mikemix/mxrecaptcha
Files in mikemix/mxrecaptcha
Package mxrecaptcha
Short Description ZF2 Form integration with v2.0 reCaptcha
License MIT
Informations about the package mxrecaptcha
mxreCaptcha
Easy ZF2 form integration with reCaptcha v2.0
Installation
- Install with Composer
php composer.phar require 'mikemix/mxrecaptcha:~1.0'
(we follow the rules of Semantic Versioning) - Load the
mxreCaptcha
module in yourconfig/application.config.php
file - Copy the dist config file
cp vendor/mikemix/mxrecaptcha/config/mxrecaptcha.local.php.dist config/autoload/mxrecaptcha.local.php
and write your private and public key in it - You are ready to go!
Usage
First of all, add the reCaptcha element to your form. Example form class below:
Example controller
Example view
Localization
By default, Polish translation for localized error messages is available out of the box.
To create custom translation for your application, simply copy the pl.po
file from the language
directory
and name it accordingly to match your translator locale
setting (for example fr_ca.po
). Finally translate
error messages and compile this file to *.mo
. Put those two files inside the language
directory.
If you are willing to share your translation, please make a pull request.
Unit tests
This modules comes up with unit tests. phpUnit is required to run the suite:
- Clone this repository
git clone https://github.com/mikemix/mxreCaptcha.git
- Navigate to it
cd mxreCaptcha
- Download composer
php -r "readfile('https://getcomposer.org/installer');" | php
- Install dependencies
php composer.phar update
- Run suite
phpunit