Skip to content

Instantly share code, notes, and snippets.

@simistern
Created August 15, 2017 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simistern/063d3e1460723f36f74676101ee33781 to your computer and use it in GitHub Desktop.
Save simistern/063d3e1460723f36f74676101ee33781 to your computer and use it in GitHub Desktop.
public function index($id = false)
{
switch ($this->request_method) {
case API_METHOD_GET:
return $this->get_all_user_vehicles();
break;
case API_METHOD_POST:
return $this->create_user_vehicle();
break;
default:
# code...
break;
}
$this->_set_status_message(HTTP_STATUS_NOT_FOUND, 'Not found');
}
public function create_user_vehicle()
{
error_log("----------------Inside simons api----------------");
$user_vehicle = false;
$make_id3 = $this->input->get_post('*');
$make_id4 = $this->input->get_post('service_request');
error_log(print_r($make_id4,true));
error_log(print_r($make_id3,true));
error_log(print_r($_POST, true));
error_log(print_r($_POST['service_request'], true));
error_log(print_r($_POST['*'], true));
error_log(print_r($_POST['body'], true));
$this->_set_status_message(300, 'Vehicle was successfully addedsd');
$this->_return_api([
'user_vehicle' => $user_vehicle
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment