Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yfwz100/wechat.php
A collection of code for Wechat Media Platform, written in PHP.
https://github.com/yfwz100/wechat.php
Last synced: 7 days ago
JSON representation
A collection of code for Wechat Media Platform, written in PHP.
- Host: GitHub
- URL: https://github.com/yfwz100/wechat.php
- Owner: yfwz100
- License: mit
- Created: 2015-10-17T08:44:31.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-18T07:53:16.000Z (over 8 years ago)
- Last Synced: 2024-04-20T11:52:56.247Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 10
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Wechat.php
================Wechat.php is an effort to create an elegant utility to interact with Server of [Wechat Media Platform][WechatMP], in PHP. Wechat.php is designed to work well with modern PHP environment, including namespaces and composer. The API is strongly influenced by [a fluent package written in Node.js][wx], written in modern PHP syntax. We hope this collection of code could benefit anyone who works with an account of [Wechat Media Platform][WechatMP].
The design of the library strictly follows the design of the Wechat Web API and provides functions/classes to facilitate your development. -- **We do the painful things for you!**
Installation
------------Though 'Wehcat.php' is designed to work with composer, the library is not yet uploaded and is under construction. Please add repository to your `composer.json`:
```json
"repositories": [
{
"type": "vcs",
"url": "https://git.oschina.net/zhi/wechat.php.git"
}
]
```Then add dependency:
```json
"require": {
"yfwz100/wechat": "dev-master"
}
```Example
-------```php
event->on('subscribe', function () {
// use `echo` to output everything you want just like plain PHP.
// wechat\Reply class will generate the necessary XML for you.
echo wechat\Reply::text("Welcome subscribing~");
});// click action is subsection of events.
$router->event->click->match('clicked', function ($matches) {
echo wechat\Reply::text("You've clicked 'clicked'!");
});// Keyword reply.
$router->text->match('hello', function ($matches) {
echo wechat\Reply::text("Hello, world!");
});
```Author
------Zhi - [email protected]
License
-------MIT.
[WechatMP]: http://mp.weixin.qq.com/ "The home page of WechatMP."
[wx]: http://www.weixinjs.org "The wx module for Node.js ."