PHP code example of peijunyang / yii2-wechat

1. Go to this page and download the library: Download peijunyang/yii2-wechat library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

peijunyang / yii2-wechat example snippets


return [
    ...
    'components' => [
        ....
        'wechat' => [
            'class' => 'peijunyang\wechat\Component',
            'config' => [
                'type'=>'common', // 微信账号类型, common 普通, qy 企业
                'token'=>'tokenaccesskey', //填写你设定的key
                'encodingaeskey'=>'encodingaeskey', //填写加密用的EncodingAESKey
                'appid'=>'wxdk1234567890', //填写高级调用功能的app id, 请在微信开发模式后台查询
                'appsecret'=>'xxxxxxxxxxxxxxxxxxx' //填写高级调用功能的密钥
            ],
        ]
    ],
];

$weObj = Yii::$app->wechat->getWechat(); //获取wechat对象实例
 //TODO:调用$weObj各实例方法

php composer.phar