2012-07-02 216 views
0

我尝试了这段代码,并不断收到此错误 函数来创建(){笨卷曲错误

$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); 

这是错误我得到

严重性:注意

消息:未定义的财产:学院:: $卷曲

文件名:controllers/colleges.php

回答

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);