PHPackages                             haotong/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. [API Development](/categories/api)
4. /
5. haotong/yii2-wechat

ActiveLibrary[API Development](/categories/api)

haotong/yii2-wechat
===================

yii2 wechat

00PHP

Since Oct 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/linjiewen/yii-wechat)[ Packagist](https://packagist.org/packages/haotong/yii2-wechat)[ RSS](/packages/haotong-yii2-wechat/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (1)Used By (0)

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

[](#yii2-wechat)

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

配置
--

[](#配置)

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

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60% 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/cced686649e33bd07d2300a3d3903b3e903a3e0ca319996b1bab2abaaabf4b58?d=identicon)[haotong](/maintainers/haotong)

---

Top Contributors

[![dyg-cn](https://avatars.githubusercontent.com/u/82805608?v=4)](https://github.com/dyg-cn "dyg-cn (3 commits)")[![linjiewen](https://avatars.githubusercontent.com/u/7269349?v=4)](https://github.com/linjiewen "linjiewen (2 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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