PHPackages                             mikemix/mxrecaptcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. mikemix/mxrecaptcha

AbandonedLibrary[Authentication &amp; Authorization](/categories/authentication)

mikemix/mxrecaptcha
===================

ZF2 Form integration with v2.0 reCaptcha

1.2.0(10y ago)2862MITPHPPHP &gt;=5.5

Since Sep 9Pushed 10y agoCompare

[ Source](https://github.com/mikemix/mxreCaptcha)[ Packagist](https://packagist.org/packages/mikemix/mxrecaptcha)[ RSS](/packages/mikemix-mxrecaptcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

mxreCaptcha
===========

[](#mxrecaptcha)

[![Build Status](https://camo.githubusercontent.com/219e9b7084e8de63296663814d9d8a7dd70d355cd60e131bc4354c5d6a2788db/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696b656d69782f6d787265436170746368612f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mikemix/mxreCaptcha/build-status/master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/4d2e66d29d2049eca56664032b5ff5d270ea6295b74f0e2f865275bed8e0a1a1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696b656d69782f6d787265436170746368612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mikemix/mxreCaptcha/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/155078ec75253d4cf732a71e51aaa6e872a5129d5a41574240fc995aaf8944b6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696b656d69782f6d787265436170746368612f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mikemix/mxreCaptcha/?branch=master)

Easy ZF2 form integration with reCaptcha v2.0

Installation
------------

[](#installation)

1. Install with Composer `php composer.phar require 'mikemix/mxrecaptcha:~1.0'` (we follow the rules of [Semantic Versioning](http://semver.org/))
2. Load the `mxreCaptcha` module in your `config/application.config.php` file
3. 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
4. You are ready to go!

Usage
-----

[](#usage)

First of all, add the reCaptcha element to your form. Example form class below:

```
namespace App\Form;

use Zend\Form\Form;

class AddForm extends Form
{
    public function init()
    {
        $this->add([
            'name' => 'recaptcha',   // or any name of your choice
            'type' => 'mxreCaptcha', // this is important, use our reCaptcha component
            'options' => [
                'label' => 'Prove you are human',
            ],
        ]);

        // or

        // This element behaves as any other element.
        // Aside from that, you can pass custom grecaptcha.render parameters
        // available at the docs
        // https://developers.google.com/recaptcha/docs/display#render_param
        // by setting widget_options key in the options, for example:

        $this->add([
            'name' => 'recaptcha',
            'type' => 'mxreCaptcha',
            'options' => [
                'label' => 'Prove you are human',
                'widget_options' => [
                    'theme' => 'dark',
                ],
            ],
        ]);

        $this->add([
            'name' => 'submit',
            'type' => 'submit',
        ]);
    }
}
```

Example controller

```
namespace App\Controller;

use App\Form\AddForm;
use Zend\Mvc\Controller\AbstractActionController;

class FormController extends AbstractActionController
{
    public function indexAction()
    {
        $form = $this->getServiceLocator()->get('FormElementManager')
            ->get(AddForm::class);

        if ($this->request->isPost()) {
            $form->setData($this->request->getPost());

            if ($form->isValid()) {
                $this->flashMessenger()->addSuccessMessage('Success!');
                return $this->redirect()->toRoute('home');
            }
        }

        return [
            'form' => $form
        ];
    }
}
```

Example view

```

```

Localization
------------

[](#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
----------

[](#unit-tests)

This modules comes up with unit tests. phpUnit is required to run the suite:

1. Clone this repository `git clone https://github.com/mikemix/mxreCaptcha.git`
2. Navigate to it `cd mxreCaptcha`
3. Download composer `php -r "readfile('https://getcomposer.org/installer');" | php`
4. Install dependencies `php composer.phar update`
5. Run suite `phpunit`

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity63

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

3904d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f120faf0f68744fbc357d36e55bb78ec43fa3c2c81eb70f476893540ef1621f?d=identicon)[mikemix](/maintainers/mikemix)

---

Tags

recaptchazf2Zend Frameworkzf2 form

### Embed Badge

![Health badge](/badges/mikemix-mxrecaptcha/health.svg)

```
[![Health](https://phpackages.com/badges/mikemix-mxrecaptcha/health.svg)](https://phpackages.com/packages/mikemix-mxrecaptcha)
```

###  Alternatives

[google/recaptcha

Client library for reCAPTCHA, a free service that protects websites from spam and abuse.

3.6k89.1M222](/packages/google-recaptcha)[anhskohbo/no-captcha

No CAPTCHA reCAPTCHA For Laravel.

1.8k8.5M33](/packages/anhskohbo-no-captcha)[albertcht/invisible-recaptcha

Invisible reCAPTCHA For Laravel.

6031.6M6](/packages/albertcht-invisible-recaptcha)[zf-commons/zfc-user

A generic user registration and authentication module for ZF2. Supports Zend\\Db and Doctrine2.

4851.1M70](/packages/zf-commons-zfc-user)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[arcanedev/no-captcha

No CAPTCHA (new Google reCAPTCHA) with Laravel support

370730.4k6](/packages/arcanedev-no-captcha)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
