Response
Table of Contents
-
STATUS_TEXT
= [200 => "OK", 201 => "Created", 204 => "No Content", 400 => "Bad Request", 401 => "Unauthorized", 403 => "Forbidden", 404 => "Not Found", 405 => "Method Not Allowed", 500 => "Internal Server Error", 501 => "Not Implemented", 502 => "Bad Gateway", 503 => "Service Unavailable"]
-
$content
: string
-
$headers
: array<string|int, mixed>
-
$request
: Request
-
$statusCode
: string
-
__construct()
: mixed
-
appendContent()
: mixed
-
JSON()
: Response
-
redirect()
: mixed
-
send()
: mixed
-
sendContent()
: mixed
-
sendHeaders()
: mixed
-
setContent()
: Response
-
setHeader()
: Response
-
setHeaders()
: Response
-
setStatusCode()
: Response
STATUS_TEXT
public
mixed
STATUS_TEXT
= [200 => "OK", 201 => "Created", 204 => "No Content", 400 => "Bad Request", 401 => "Unauthorized", 403 => "Forbidden", 404 => "Not Found", 405 => "Method Not Allowed", 500 => "Internal Server Error", 501 => "Not Implemented", 502 => "Bad Gateway", 503 => "Service Unavailable"]
$content
public
string
$content
= ""
public
array<string|int, mixed>
$headers
= []
$request
protected
Request
$request
$statusCode
private
string
$statusCode
= "200"
__construct()
public
__construct(Request $request) : mixed
Parameters
-
$request
: Request
-
Return values
mixed
—
appendContent()
public
appendContent(mixed $data) : mixed
Parameters
-
$data
: mixed
-
Return values
mixed
—
JSON()
public
static JSON([mixed $data = [] ][, int $status = 200 ][, array<string|int, mixed> $headers = [] ]) : Response
Parameters
-
$data
: mixed
= []
-
-
$status
: int
= 200
-
-
$headers
: array<string|int, mixed>
= []
-
Return values
Response
—
redirect()
public
static redirect(string $url[, int $status = 302 ]) : mixed
Parameters
-
$url
: string
-
-
$status
: int
= 302
-
Return values
mixed
—
send()
public
send() : mixed
Return values
mixed
—
sendContent()
public
sendContent() : mixed
Return values
mixed
—
public
sendHeaders() : mixed
Return values
mixed
—
setContent()
public
setContent(string $content) : Response
Parameters
-
$content
: string
-
Return values
Response
—
public
setHeader(string $name, string $value) : Response
Parameters
-
$name
: string
-
-
$value
: string
-
Return values
Response
—
public
setHeaders(array<string|int, mixed> $headers) : Response
Parameters
-
$headers
: array<string|int, mixed>
-
Return values
Response
—
setStatusCode()
public
setStatusCode(string $statusCode) : Response
Parameters
-
$statusCode
: string
-
Return values
Response
—