ControllerResponseTrait
Trait ControllerResponseTrait
Table of Contents
Methods
- createDisplayResponse() : Response
- Display the current page.
- createDownloadResponse() : ResponseInterface
- createErrorResponse() : ResponseInterface
- createHtmlResponse() : Response
- createJsonErrorResponse() : ResponseInterface
- createJsonResponse() : Response
- createRedirectResponse() : Response
- getAccept() : mixed
- getConfig() : Config
- getErrorCode() : int
- getErrorJson() : array<string|int, mixed>
- getRequest() : ServerRequestInterface
- setMessage() : $this
Methods
createDisplayResponse()
Display the current page.
protected
createDisplayResponse() : Response
Return values
ResponsecreateDownloadResponse()
protected
createDownloadResponse(string $filename, string|resource|StreamInterface $resource[, array<string|int, mixed>|null $headers = null ][, array<string|int, mixed>|null $options = null ]) : ResponseInterface
Parameters
- $filename : string
- $resource : string|resource|StreamInterface
- $headers : array<string|int, mixed>|null = null
- $options : array<string|int, mixed>|null = null
Return values
ResponseInterfacecreateErrorResponse()
protected
createErrorResponse(Throwable $e) : ResponseInterface
Parameters
- $e : Throwable
Return values
ResponseInterfacecreateHtmlResponse()
protected
createHtmlResponse(string $content[, int|null $code = null ][, array<string|int, mixed>|null $headers = null ]) : Response
Parameters
- $content : string
- $code : int|null = null
- $headers : array<string|int, mixed>|null = null
Return values
ResponsecreateJsonErrorResponse()
protected
createJsonErrorResponse(Throwable $e) : ResponseInterface
Parameters
- $e : Throwable
Return values
ResponseInterfacecreateJsonResponse()
protected
createJsonResponse(array<string|int, mixed> $content[, int|null $code = null ][, array<string|int, mixed>|null $headers = null ]) : Response
Parameters
- $content : array<string|int, mixed>
- $code : int|null = null
- $headers : array<string|int, mixed>|null = null
Return values
ResponsecreateRedirectResponse()
protected
createRedirectResponse(string $url[, int|null $code = null ]) : Response
Parameters
- $url : string
- $code : int|null = null
Return values
ResponsegetAccept()
protected
getAccept(array<string|int, mixed> $compare) : mixed
Parameters
- $compare : array<string|int, mixed>
getConfig()
protected
abstract getConfig() : Config
Return values
ConfiggetErrorCode()
protected
getErrorCode(int $code) : int
Parameters
- $code : int
Return values
intgetErrorJson()
protected
getErrorJson(Throwable $e) : array<string|int, mixed>
Parameters
- $e : Throwable
Return values
array<string|int, mixed>getRequest()
protected
abstract getRequest() : ServerRequestInterface
Return values
ServerRequestInterfacesetMessage()
protected
abstract setMessage(string $message[, string $type = 'info' ]) : $this
Parameters
- $message : string
- $type : string = 'info'