El Forum
08-08-2012, 04:06 PM
[eluser]chubbypama[/eluser]
Hi there.
we have an opensource application that contains data i need to integrate with a new ci app that i'm building.
i have a controller called "objects" and it will have a method called "getallobjects".
This method actually has to return data from the external application.
There is an "api" of sorts for the application, but the way that I call it is by getting a URL like:
http://localhost/externalapp/abc.php?method=get_allobjects
this returns a bunch of json encoded data.
how would i use this type of an api in my mvc ci app?
so far, this is what my controller looks like:
Thanks.
Hi there.
we have an opensource application that contains data i need to integrate with a new ci app that i'm building.
i have a controller called "objects" and it will have a method called "getallobjects".
This method actually has to return data from the external application.
There is an "api" of sorts for the application, but the way that I call it is by getting a URL like:
http://localhost/externalapp/abc.php?method=get_allobjects
this returns a bunch of json encoded data.
how would i use this type of an api in my mvc ci app?
so far, this is what my controller looks like:
Code:
class Objects extends CI_Controller {
public function __construct()
{
parent::__construct();
//$this->load->model('netswitch');
$this->load->helper('url');
}
public function getallobjects()
{
$data['objectlist'] = ????
$data['main_content']='objects';
$this->load->view('includes/template', $data);
}
}
Thanks.