Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

监听事件时不区分 $target(监听所有event和message) #3

Closed
zerozh opened this issue Mar 24, 2015 · 5 comments
Closed

监听事件时不区分 $target(监听所有event和message) #3

zerozh opened this issue Mar 24, 2015 · 5 comments

Comments

@zerozh
Copy link
Contributor

zerozh commented Mar 24, 2015

用作日志监控等
也可以方便以后微信拓展新的msgtype类型

@overtrue
Copy link
Collaborator

@zerozh 麻烦说清楚一点,没太看明白

@overtrue
Copy link
Collaborator

@zerozh 明白了

@overtrue
Copy link
Collaborator

@zerozh 可是那样的话,就没办法指定监听某一类了?而是把这个类型筛选完全交给用户来实现了?

@zerozh
Copy link
Contributor Author

zerozh commented Mar 24, 2015

@overtrue 这样做有两个好处:为了方便统一记录日志;方便高级用户完全自定义类型筛选

@overtrue
Copy link
Collaborator

@zerozh 像下面这样?

$response = $wechat->serve(function($message){
switch($message->MsgType) {
         case 'event':
                  // handle event
                  break;
         case 'message' :
                  // handle message
                  break;
    }
});

return $response;

@zerozh zerozh closed this as completed Mar 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants