codeigniter Retrieve some data from API add following function in API controller


Example

/*****************************
@return all events
****************************/
public function getallevents(){
  //get data from model
  $events = array(
    array('Event 1', '2015-04-03'),
    array('Event 2', '2015-04-03'),
    array('Event 3', '2015-06-16'),
    array('Event 4', '2015-06-29'),
    array('Event 5', '2015-07-04'),
    array('Event 6', '2015-12-25'),
    array('Event 7', '2016-01-01')
  );
  $this->output->set_output(json_encode(array('status'=>true,'events'=>$events)));
}

Postman view enter image description here