PHPackages                             sashsvamir/yii2-recaptcha-widget - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sashsvamir/yii2-recaptcha-widget

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

sashsvamir/yii2-recaptcha-widget
================================

Yii2 Google reCAPTCHA widget

14681PHP

Since Dec 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/sashsvamir/yii2-recaptcha-widget)[ Packagist](https://packagist.org/packages/sashsvamir/yii2-recaptcha-widget)[ RSS](/packages/sashsvamir-yii2-recaptcha-widget/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

ReCaptcha Widget
================

[](#recaptcha-widget)

Widget to render [google recaptcha](https://developers.google.com/recaptcha/) and validate this field.

This implementaion allow to use:

- multiple widgets on one page
- also you can load page by ajax several times

[![recaptcha](https://camo.githubusercontent.com/65117b0de2f6a297f74dfae2f1552eb1e30dccfd52b9a5a0c94f0b5a2ee5cb5e/68747470733a2f2f646576656c6f706572732e676f6f676c652e636f6d2f7265636170746368612f696d616765732f6c696768742e706e67)](https://camo.githubusercontent.com/65117b0de2f6a297f74dfae2f1552eb1e30dccfd52b9a5a0c94f0b5a2ee5cb5e/68747470733a2f2f646576656c6f706572732e676f6f676c652e636f6d2f7265636170746368612f696d616765732f6c696768742e706e67)

### Information

[](#information)

Now this widget extends [himiklab/yii2-recaptcha-widget](https://github.com/himiklab/yii2-recaptcha-widget) extension (automatic loading as depends in composer.json)

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

[](#installation)

Just add extension to composer require section:

`composer require sashsvamir/yii2-recaptcha-widget:"dev-master"`

Setup
-----

[](#setup)

Setup recaptcha config `common/config/main.php`:

```
'components' => [
    // ...
    'reCaptcha' => [
        'name' => 'reCaptcha',
        'class' => 'sashsvamir\yii2\recaptcha\ReCaptcha',
        'siteKey' => '',
        'secret' => '',
    ],
],
```

To debug, use follow keys:

```
'siteKey' => '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI',
'secret' => '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe',
```

see:

Using
-----

[](#using)

Add ReCaptchaValidator in your model, for example:

```
public $verifyCode;

public function rules()
{
  return [
    // ...
    ['verifyCode', ReCaptchaValidator::className(), 'uncheckedMessage' => 'Please confirm that you are not a bot.',
      // add follow lines to prevent checking recaptcha when from has errors
      'when' => function ($model) {
        return !$model->hasErrors();
      }
    ],
  ];
}
```

### Render ReCaptcha field:

[](#render-recaptcha-field)

```
$form->field($model, 'verifyCode')->widget(\sashsvamir\yii2\recaptcha\ReCaptcha::className())->label(false);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f6536c9f8af43a09edd5f23d3bd78a170cc0441319ebcd42528588dd0285d959?d=identicon)[sashsvamir](/maintainers/sashsvamir)

---

Top Contributors

[![sashsvamir](https://avatars.githubusercontent.com/u/1404421?v=4)](https://github.com/sashsvamir "sashsvamir (4 commits)")[![ztdan4ik](https://avatars.githubusercontent.com/u/14123515?v=4)](https://github.com/ztdan4ik "ztdan4ik (1 commits)")

### Embed Badge

![Health badge](/badges/sashsvamir-yii2-recaptcha-widget/health.svg)

```
[![Health](https://phpackages.com/badges/sashsvamir-yii2-recaptcha-widget/health.svg)](https://phpackages.com/packages/sashsvamir-yii2-recaptcha-widget)
```

###  Alternatives

[jalle19/php-yui-compressor

A modern PHP wrapper for the YUI compressor

17972.2k3](/packages/jalle19-php-yui-compressor)

PHPackages © 2026

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