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

ファイル名:controllers / 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 に答える