正确引用了SDK
正确使用了命名空间
运行提示报错
是SDK自身的错误还是 thinkphp的配置错误呢?
代码:
<?php
namespace Home\Controller;Vendor('Leancloud.autoload'); //载入leancloud sdk
use Think\Controller;
use LeanCloud\LeanUser;
use LeanCloud\CloudException;
use LeanCloud\LeanQuery;class IndexController extends Controller {
public function beforeindex(){
\LeanCloud\LeanClient::initialize(C('app_id'), C('app_key'), C('master_key'));
}public function index(){ $query = new LeanQuery("TestObject"); $obj = $query->get('5614bafd60b2caf1ee42a707'); echo $obj; }
}
报错信息
-
创建时间
15年11月25日
-
最后回复
15年11月26日
-
5
回复
-
1.4K
浏览
-
2
用户
-
1
链接