Elemental

Response
in package

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

Constants

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"]

Properties

$headers

public array<string|int, mixed> $headers = []

$statusCode

private string $statusCode = "200"

Methods

__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

sendHeaders()

public sendHeaders() : mixed
Return values
mixed

setHeader()

public setHeader(string $name, string $value) : Response
Parameters
$name : string
$value : string
Return values
Response

setHeaders()

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

Search results