Response
in package
Table of Contents
- $createOnly : bool
- $headers : array<string|int, mixed>
- $response : Response
- __construct() : mixed
- Response constructor.
- createOnly() : self
- Set create only.
- download() : BinaryFileResponse
- Create a new file download response.
- getCreateOnly() : bool
- Get create only.
- getHeaders() : array<string|int, mixed>
- Get global headers.
- replaceHeaders() : Response
- Replace headers.
- send() : Response
- Create and send a response.
- setHeaders() : Response
- Set headers.
Properties
$createOnly
protected
bool
$createOnly
= true
$headers
protected
array<string|int, mixed>
$headers
= []
$response
protected
Response
$response
Methods
__construct()
Response constructor.
public
__construct() : mixed
Return values
mixed —createOnly()
Set create only.
public
createOnly(bool $state) : self
Parameters
- $state : bool
Return values
self —download()
Create a new file download response.
public
download(SplFileInfo|string $file[, string $name = null ][, array<string|int, mixed> $headers = [] ][, string|null $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT ]) : BinaryFileResponse
Parameters
- $file : SplFileInfo|string
- $name : string = null
- $headers : array<string|int, mixed> = []
- $disposition : string|null = ResponseHeaderBag::DISPOSITION_ATTACHMENT
Return values
BinaryFileResponse —getCreateOnly()
Get create only.
public
getCreateOnly() : bool
Return values
bool —getHeaders()
Get global headers.
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed> —replaceHeaders()
Replace headers.
public
replaceHeaders(array<string|int, mixed> $headers) : Response
Parameters
- $headers : array<string|int, mixed>
Return values
Response —send()
Create and send a response.
public
send(mixed $content[, int $status = HttpResponse::HTTP_OK ][, array<string|int, mixed> $headers = [] ]) : Response
Parameters
- $content : mixed
-
Response data.
- $status : int = HttpResponse::HTTP_OK
-
Http status code.
- $headers : array<string|int, mixed> = []
-
Headers.
Return values
Response —setHeaders()
Set headers.
public
setHeaders(array<string|int, mixed> $headers) : Response
Parameters
- $headers : array<string|int, mixed>