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

22 lines
729 B
PHP
Raw Normal View History

2021-03-09 09:45:05 +00:00
<?php
2021-03-19 12:38:13 +00:00
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Max-Age: 1000");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Origin, Cache-Control, Pragma, Authorization, Accept, Accept-Encoding");
header("Access-Control-Allow-Methods: PUT, POST, GET, OPTIONS, DELETE");
2021-04-19 07:15:15 +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
2021-04-19 07:15:15 +00:00
if (isset($_GET['gameJamId'])) {
$dbValue = GameJam::find($_GET['gameJamId']);
} else {
2021-03-11 13:22:19 +00:00
$dbValue = GameJam::all();
}
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());