I have developed a library in CodeIgniter and would like to call a function that exists on the curl sparks library. How can I make a call to the function from within my library?
I have tried
$this->load->spark('curl/2.1.2');
$this->curl->simple_get('url');
doesn’t seem to be working.
I have also tried
$CI =& get_instance();
$CI->load->spark('curl/1.2.1');
$this->curl->simple_get('url');
This also doesn’t seem to work. Can you please advice on how I can achieve this?
I use the curl sparks library http://getsparks.org/packages/curl/versions/HEAD/show
Edit: This question is not in relation to Codeigniter: Consume RESTful service as this mostly deals with how to call a method on a Spark Library from within a standalone Code Igniter library
I figured it out myself. We would have to use it as below
This works correctly.