0

我正在尝试这段代码并继续获取此错误函数 create(){

    $post = array();

    //get all the data from the form into an array
    $post = array(
                'name' => $this->input->post('name'),
                'abbrev' => $this->input->post('abbrev'),           
                'long_name' => $this->input->post('long_name'),
                'long_abbrev' => $this->input->post('long_abbrev'),
                'url' => $this->input->post('url'),
                'description' => $this->input->post('description')
                );  


    //encode the data and set it as output to push to api
    $json_data=json_encode($post);
    $this->curl->post('http://localhost:8888/api/colleges', $json_data);

这是我得到的错误

严重性:通知

消息:未定义的属性:Colleges::$curl

文件名:控制器/colleges.php

4

1 回答 1

0

改变

 $this->curl->post('http://localhost:8888/api/colleges', $json_data);

 $this->load->library('curl');
 $this->curl->post('http://localhost:8888/api/colleges', $json_data);
于 2012-07-02T20:33:52.357 回答