【问题标题】:Fatal error when using REST client library in CodeIgniter在 CodeIgniter 中使用 REST 客户端库时出现致命错误
【发布时间】:2013-05-07 09:25:42
【问题描述】:

我从 here 下载了 Rest Client 库,从 here 下载了 CodeIgniter 的 Curl 库。

我将这两个库都放在一个库文件夹中,并将它们设置在自动加载库中。

现在当我尝试运行以下代码时:

class Api extends CI_Controller { 

function index()  
 {   
     $this->load->spark('restclient/2.1.0');
     $this->load->library('rest', array(  
           'server' => 'my rest service url', 
    ));
      $data = $this->rest->get();  
      echo '<pre>';
    print_r($data);
     }  
}

我收到以下错误:

Fatal error: Call to undefined method CI_Loader::spark() in /opt/lampp/htdocs/code/application/libraries/Rest.php on line 60

我做错了什么?

【问题讨论】:

    标签: codeigniter restful-url


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2011-05-11
    • 1970-01-01
    • 2013-11-17
    • 1970-01-01
    • 2015-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多