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

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

huijiewei/yii2-wechat
=====================

微信扩展

3.0.0(1y ago)2251MITPHPPHP &gt;=8.0.2

Since Jun 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/huijiewei/yii2-wechat)[ Packagist](https://packagist.org/packages/huijiewei/yii2-wechat)[ RSS](/packages/huijiewei-yii2-wechat/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (0)

yii2-wechat
===========

[](#yii2-wechat)

Yii2 微信扩展

本扩展优化了微信网页授权流程

基于 [w7corp/easywechat](https://github.com/w7corp/easywechat).

安装
--

[](#安装)

```
composer require huijiewei/yii2-wechat

```

配置
--

[](#配置)

增加 `component` 配置到 `config/main.php`:

```
'components' => [
	// ...
	// componentId 可以自定义多个微信公众号进行配置
	'wechat' => [
		'class' => 'huijiewei\wechat\Wechat',
		// 'appConfig' => [],  # 公众号配置
		// 'paymentConfig' => [],  # 支付配置
		// 'miniProgramConfig' => [],  # 小程序配置
		// 'openPlatformConfig' => [],  # 开放平台配置
		// 'workConfig' => [],  # 企业微信配置
	],
	// ...
]
```

[配置文档](https://easywechat.com/6.x/official-account/config.html)

配置数据库
-----

[](#配置数据库)

```
php yii migrate --migrationPath=@vendor/huijiewei/yii2-wechat/src/migrations
```

用法
--

[](#用法)

##### 微信网页授权:

[](#微信网页授权)

```
if(Wechat::getIsWechatClient()) {
    $wechatAuthorize = new WechatAuthorize([
        'wechat' => 'wechat', // componentId, 默认是 wechat
    ]);

    if(!$wechatAuthorize->isAuthorized()) {
        return $wechatAuthorize->authorizeRequired()->send();
    }
}
```

##### JSSDK

[](#jssdk)

```
WechatShareWidget::widget([
    'wechat' => 'wechat', // componentId, 默认是 wechat
    'shareUrl' => '分享链接',
    'shareIcon' => '分享图标',
    'shareTitle' => '分享标题',
    'shareDescription' => '分享描述',
]);
```

### 更多文档

[](#更多文档)

查阅 [EasyWeChat 文档](https://www.easywechat.com/docs).

感谢 `w7corp/easywechat`

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity75

Established project with proven stability

 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

Every ~232 days

Recently: every ~487 days

Total

11

Last Release

606d ago

Major Versions

2.0.11 → 3.0.02024-10-29

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7017860?v=4)[Huijie Wei](/maintainers/huijiewei)[@huijiewei](https://github.com/huijiewei)

---

Top Contributors

[![huijiewei](https://avatars.githubusercontent.com/u/7017860?v=4)](https://github.com/huijiewei "huijiewei (18 commits)")

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)

PHPackages © 2026

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