OTA Tweeks

This commit is contained in:
JonatanRek
2020-07-14 19:59:18 +02:00
parent 8ed3ab2f39
commit 275aa97688
4 changed files with 118 additions and 116 deletions

View File

@@ -29,9 +29,13 @@ class ApiController {
}
}
protected function response($data = [], $httpCode = '200'){
header('Content-Type: application/json');
protected function response($data = [], $httpCode = '200', $contentType = 'application/json', $jsonEncode = true){
header('Content-Type: ' . $contentType);
http_response_code($httpCode);
echo json_encode($data, JSON_UNESCAPED_UNICODE);
if ($jsonEncode) {
echo json_encode($data, JSON_UNESCAPED_UNICODE);
} else {
echo $data;
}
}
}