2017 © Pedro Peláez
 

yii2-extension yii2-wechat

微信扩展

image

huijiewei/yii2-wechat

微信扩展

  • Sunday, July 8, 2018
  • by huijiewei
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

yii2-wechat

Yii2 微信扩展, (*1)

本扩展优化了微信网页授权流程, (*2)

基于 w7corp/easywechat., (*3)

安装

composer require huijiewei/yii2-wechat

配置

增加 component 配置到 config/main.php:, (*4)


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

配置文档, (*5)

配置数据库

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
WechatShareWidget::widget([
    'wechat' => 'wechat', // componentId, 默认是 wechat
    'shareUrl' => '分享链接',
    'shareIcon' => '分享图标',
    'shareTitle' => '分享标题',
    'shareDescription' => '分享描述',
]);

更多文档

查阅 EasyWeChat 文档., (*6)

感谢 w7corp/easywechat, (*7)

The Versions

08/07 2018

dev-master

9999999-dev

微信扩展

  Sources   Download

MIT

The Requires

 

by Huijie Wei

08/07 2018

2.0.6

2.0.6.0

微信扩展

  Sources   Download

MIT

The Requires

 

by Huijie Wei

17/06 2018

v2.0.3

2.0.3.0

微信扩展

  Sources   Download

MIT

The Requires

 

by Huijie Wei

17/06 2018

2.0.5

2.0.5.0

微信扩展

  Sources   Download

MIT

The Requires

 

by Huijie Wei

16/06 2018

v2.0.2

2.0.2.0

微信扩展

  Sources   Download

MIT

The Requires

 

by Huijie Wei

16/06 2018

v2.0.1

2.0.1.0

微信扩展

  Sources   Download

MIT

The Requires

 

by Huijie Wei