diff --git a/common/Define/Controller/Json.php b/common/Define/Controller/Json.php new file mode 100644 index 0000000..76dd338 --- /dev/null +++ b/common/Define/Controller/Json.php @@ -0,0 +1,20 @@ +getBody()->write($data); + return $request + ->withHeader('Content-Type', 'application/json') + ->withStatus(201); + } +} diff --git a/common/Define/Controller/Redirect.php b/common/Define/Controller/Redirect.php new file mode 100644 index 0000000..5b796be --- /dev/null +++ b/common/Define/Controller/Redirect.php @@ -0,0 +1,12 @@ +withHeader('Location', $uri) + ->withStatus($status); + } +}