从 API 控制器中的 API 添加以下函数中检索一些数据

/*****************************
@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)));
}

邮差查看 https://i.stack.imgur.com/vOkg2.jpg