PHPackages                             dungang/yii2-geetest - 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. dungang/yii2-geetest

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

dungang/yii2-geetest
====================

geetest for YII2 极验证码

0.0.1(7y ago)157MITPHPPHP &gt;=5.4.0

Since Jun 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/dungang/yii2-geetest)[ Packagist](https://packagist.org/packages/dungang/yii2-geetest)[ RSS](/packages/dungang-yii2-geetest/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

yii2-geetest
============

[](#yii2-geetest)

yii2-geetest 是基于YII2框架对极验证码的封装。要使用此验证码需要申请appkey，具体请查阅极验证码的官网文档。

[![验证码效果图](assets/images/captche.png)](assets/images/captche.png)

使用方法
----

[](#使用方法)

> 下载验证码包

```

composer require dungang/yii2-geetest

```

> 编辑项目的配置文件，比如 config/web.php &amp;&amp; config/params.php

web.php 添加如下代码

```
    'modules'=>[
        'geetest'=>['class'=>'dungang\geetest\Module']
    ],

```

params.php 添加如下代码

```

    'geetest'=>[
        'userId'=>'test',
        'appPcId'=>'b46d1900d0a894591916ea94ea91bd2c',
        'appPcKey'=>'36fc3fe98530eea08dfc6ce76e3d24c4',
        'appMobileId'=>'7c25da6fe21944cfe507d2f9876775a9',
        'appMobileKey'=>'f5883f4ee3bd4fa8caec67941de1b903',
    ],

```

> 编辑表单模型文件，比如 LoginForm.php

配置验证规则的组建

```
    /**
     * @return array the validation rules.
     */
    public function rules()
    {
        return [
            // userName and password are both required
            [['userName', 'password'], 'required'],
            // verifyCode needs to be entered correctly
            ['verifyCode',\dungang\geetest\validators\CaptchaValidator::className()],
            // rememberMe must be a boolean value
            ['rememberMe', 'boolean'],
            // password is validated by validatePassword()
            ['password', 'validatePassword'],
        ];
    }

```

> 编辑视图文件，比如 login.php

需要跟表单的提交按钮绑定

```

```

widget 参数配置
-----------

[](#widget-参数配置)

```
[
    'platform'=>'pc',  //默认是pc ，还可以设置为mobile 移动端
    'captchaId'=>'geetest' //极验证码的id
    'clientOptions'=>[
        'submitButton'=>'#submit', //绑定表单的提交按钮
        'showType'=>'float' //验证码的展现形式，之支持pc端，可选值：embed,float,popup
    ],

]

```

依赖
--

[](#依赖)

"gee-team/gt-php-sdk":"v3.2.0"

协议 MIT
------

[](#协议-mit)

The MIT License (MIT)

Copyright (c) 2017 dungang

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2896d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7221526?v=4)[顿刚](/maintainers/dungang)[@dungang](https://github.com/dungang)

---

Top Contributors

[![dungang](https://avatars.githubusercontent.com/u/7221526?v=4)](https://github.com/dungang "dungang (13 commits)")

### Embed Badge

![Health badge](/badges/dungang-yii2-geetest/health.svg)

```
[![Health](https://phpackages.com/badges/dungang-yii2-geetest/health.svg)](https://phpackages.com/packages/dungang-yii2-geetest)
```

###  Alternatives

[rmrevin/yii2-ulogin

Extension for yii2 ulogin integration

1811.9k](/packages/rmrevin-yii2-ulogin)[kakadu-dev/yii2-jwt-auth

Extension provide JWT auth for Yii2

105.8k](/packages/kakadu-dev-yii2-jwt-auth)

PHPackages © 2026

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