Game-Jaming/Backend/Controllers/GameJam/GetGameJam.php

18 lines
502 B
PHP
Raw Normal View History

2021-03-09 09:45:05 +00:00
<?php
2021-03-16 12:19:17 +00:00
require_once (realpath(dirname(__FILE__) ."/../../../bootstrap.php"));
2021-03-10 10:23:40 +00:00
use Backend\Models\GameJam;
2021-03-11 13:22:19 +00:00
if(isset($_GET['gameJamId'])){
$dbValue = GameJam::find($_GET['gameJamId']);
}else{
$dbValue = GameJam::all();
}
2021-03-16 11:25:22 +00:00
header("Access-Control-Allow-Methods: GET");
2021-03-19 08:18:19 +00:00
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
2021-03-10 10:23:40 +00:00
header('Content-Type: application/json;charset=UTF-8');
2021-03-22 14:29:18 +00:00
echo json_encode(array('data' => $dbValue->jsonSerialize()));
2021-03-19 08:18:19 +00:00
//var_dump(headers_list());