0

I downloaded the Rest Client library from here and the Curl library for CodeIgniter from here.

I put both the libraries in a library folder and set them in auto load library.

Now when I try to run the following code:

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

I'm getting the following error:

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

What am I doing wrong?

Simon MᶜKenzie
  • 8,344
  • 13
  • 50
  • 77
user1414979
  • 92
  • 4
  • 11

1 Answers1

1

I think you have to install spark. Look these links

http://net.tutsplus.com/tutorials/php/easy-package-management-for-codeigniter-with-sparks/

http://ellislab.com/blog/entry/a-quick-look-at-sparks

Regards

iijb

iijb
  • 222
  • 3
  • 12