调用不到本类的方法

浏览:365 发布日期:2019/06/26 分类:求助交流
namespace Lib\Util;
class ChuanglanSmsUtil {
public function curlPost($url,$postFields){
 方法内容
}

public function sendInternational( $mobile, $msg) {
    
        //创蓝接口参数
        $postArr = array (
            'account'  =>  self::API_ACCOUNT,
            'password' => self::API_PASSWORD,
            'msg' => $msg,
            'mobile' => $mobile
        );
        
        $result = $this->curlPost(self::API_SEND_URL , $postArr);
        return $result;
    }

结果报错
Think\Controller:curlPost方法不存在!
1 D:\wamp64\www\ticket\Application\Lib\Util\ChuanglanSmsUtil.class.php(83): Think\Controller->__call('curlPost', Array)
#2 D:\wamp64\www\ticket\Application\Lib\Util\ChuanglanSmsUtil.class.php(83): Api\Controller\UserController->curlPost('http://intapi.2...', Array)
分明上面就定义了这个方法,为啥调用不到呢?
而改成静态方法又可以调用到
最佳答案
评论( 相关
后面还有条评论,点击查看>>