PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Zimo Xiao   WeChat PHP API Example Class   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: WeChat PHP API Example Class
Exchange messages with WeChat users
Author: By
Last change:
Date: 4 years ago
Size: 2,987 bytes
 

Contents

Class file image Download

<p align="center"><img width="320" src="https://xy.zuggr.com/file/angel_wechat.jpg"></p>

????

Angel?? ???Angel??????????

??

????Composer??Angel??:

composer create-project angel-project/framework .

????????:

composer require angel-project/wechat

GitHub php GitHub license

?????

???????/?????

  build::post('your/url',function(){

    $wx = new angel\wechat($appid,$secret,$token); //?????object

    $wx->listen('text','hi',function($input,$wx){
      $wx->return('text',[
        'to' => $input->FromUserName,
        'content' => 'hello!'
      ]);
    }); //?????hi???????hello!

    $wx->listen('event','subscribe',function($input,$wx){
      $wx->return('news',[
        'to' => $input->FromUserName,
        'articles' => [[
          'title' => 'hi!',
          'description' => 'long time no see',
          'picurl' => 'yoururl.com/img.jpg',
          'url' => 'yoururl.com'
        ]]
      ]); //????
    }); //???????????????

    $wx->run(); //????

  });

listen()???????? - ?????????text???????event?????? - ?????????????????????????SCAN?????subscribe?????CLICK???????????????????????????'empty'? - ??????????function?????????????object?????????????????????????????object???function???????????

????

  $wx = new angel\wechat($appid,$secret,$token); //?????object

  $menu = [[
    'type' => 'click',
    'name' => '????',
    'key' => 'welcome'
  ]]; //????click???????????????????????

  $at = $wx->access_token();  //??access token
  $wx->menu($at,$menu); //????

English Doc

Angel WeChat is a WeChat plugin based on Angel Framework

Installation

First, install Angel Framework with Composer using the following command:

composer create-project angel-project/framework .

Then, install Angel WeChat package:

composer require angel-project/wechat

GitHub php GitHub license