<?php
namespace Index\Controller;
use Think\Controller;
use Com\Wechat;
class WuyeController extends CheckController {
protected function _initialize(){
$token = 'weixin'; //微信后台填写的TOKEN
$wechat = new Wechat($token);
}
public function index(){
$weObj->text("hello, I'm wechat")->reply();
//在这里不能调用上面实例化的类
//如何操作才可以使用
}
public function test(){
$weObj->text("hello, I'm wechat")->reply();
//在这里不能调用上面实例化的类
//如何操作才可以使用
}
} 最佳答案