syships / yii2-wechat
The wechat SDK for the Yii2 framework
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7.2
- yiisoft/yii2: ~2.0.0
- yiisoft/yii2-httpclient: ^2.0
README
This is a personal plugin for study. It is strongly recomended that you not use it. This plugin is unstable.
It is the wechat plugin for yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist syships/yii2-wechat "*"
or add
"syships/yii2-wechat": "*"
to the require section of your composer.json
file.
Usage
Before using the extension,you can add the _ide_helper.php under your application folder.
Once the extension is installed, simply use it in your code by :
config:
'components' => [
'wechat' => [
'class' => 'syships\wechat\application',
'app_id' => 'wxe138031c9ec0a441',//appid
'secret' => '3becb42c9c13a9db50c066e633ffd872',//secret
],
],
You can use the code below to get access_token:
Yii::$app->wechat->getAccessToken();
Yii::$app->wechat->getStableAccessToken();