PHP code example of ccc008 / yii2-wechat

1. Go to this page and download the library: Download ccc008/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/ */

    

ccc008 / yii2-wechat example snippets


  ...
  'modules' => [
    ...
    'wechat' => [ // 指定微信模块
        'class' => 'callmez\wechat\Module',
        'adminId' => 1 // 填写管理员ID, 该设置的用户将会拥有wechat最高权限, 如多个请填写数组 [1, 2]
    ]
    ...
  ],
  'components' => [
    ...
    'request' => [
          ...
          'parsers' => [ // 因为模块中有使用angular.js  所以该设置是为正常解析angular提交post数据
              ...
              'application/json' => 'yii\web\JsonParser'
          ]
      ],
    ...
  ]
  ...