PHPackages                             feehi/yii2-wechat - 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. feehi/yii2-wechat

ActiveLibrary

feehi/yii2-wechat
=================

yii2 wechat

0.0.1(8y ago)2271MITPHP

Since Jan 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/liufee/yii2-wechat)[ Packagist](https://packagist.org/packages/feehi/yii2-wechat)[ Docs](http://blog.feehi.com)[ RSS](/packages/feehi-yii2-wechat/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

yii2 wechat
===========

[](#yii2-wechat)

yii2 wechat， yii2微信扩展。最适合yii2项目的微信sdk，不依赖任何其他微信sdk。

安装
--

[](#安装)

1. 使用composer composer的安装以及国内镜像设置请点击[此处](http://www.phpcomposer.com/)

    ```
    $ cd /path/to/yii2-app
    $ composer require "feehi/yii2-wechat"
    $ composer install -vvv
    ```

配置
--

[](#配置)

yii2 wechat是作为一个组件提供服务的，所以得配置yii2 wechat组件。打开common/config/main.php在components块内增加

```
    'components' => [
        'wechat' => [
            'class' => feehi\wechat\Wechat::className(),
            'appId' => 'xxx',
            'appSecret' => 'yyy',
            'token' => 'zzz',
            'encodingAesKey' => 'bbb',
            'redirectUri' => 'site/login'//回调路由
        ],
    ]
```

核心API
-----

[](#核心api)

```
    /** @var $wechat \feehi\wechat\Wechat */
    $wechat = yii::$app->get('wechat');

    $wechat->checkSignature(); //检验echoStr
    $wechat->getServerAccessToken(); //获取服务端access_token
    $wechat->createMenu(); //创建自定义菜单
    $wechat->getLoginUrl(); //获取微信登陆授权url
    $wechat->getAccessToken(); //获取用户access_token
    $wechat->getImplicitAccessToken(); //获取隐士授权用户的access_token
    $wechat->getUserInfo(); //根据用户access_token获取用户信息
    $wechat->createTempMedia(); //创建临时媒体素材
    $wechat->recieveWechatPush(); //接受微信推送的消息和事件
    $wechat->assembleWechatResponse(); //组装需要返回给微信的xml
```

P.S 以上基本上都是返回stdClass object，可以在ide中增加注释/\*\* @var $wechat \\feehi\\wechat\\Wechat \*/来跳转sdk源码。

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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

3045d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0452fe858dc13954ce183f1dc537fdbb934a8d1255cb0a57d95256db00991609?d=identicon)[liufee](/maintainers/liufee)

---

Top Contributors

[![liufee](https://avatars.githubusercontent.com/u/7278053?v=4)](https://github.com/liufee "liufee (2 commits)")

---

Tags

phpwechatyii2yii2-wechatswooleyii2wechatphp-wechatyii2-wechat

### Embed Badge

![Health badge](/badges/feehi-yii2-wechat/health.svg)

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

###  Alternatives

[callmez/yii2-wechat-sdk

The wechat api for the Yii framework

32613.6k3](/packages/callmez-yii2-wechat-sdk)[jianyan74/yii2-easy-wechat

WeChat SDK for yii2, 基于 overtrue/easywechat

14339.4k1](/packages/jianyan74-yii2-easy-wechat)[swoole-foundation/yii2-swoole-extension

running yii2 web application on swoole server

4312.3k1](/packages/swoole-foundation-yii2-swoole-extension)[yiiplus/yii2-websocket

使用yii2封装 websocket 扩展

212.6k](/packages/yiiplus-yii2-websocket)

PHPackages © 2026

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