Documentation

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

createDownloadResponse()

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
ResponseInterface

createErrorResponse()

protected createErrorResponse(Throwable $e) : ResponseInterface
Parameters
$e : Throwable
Return values
ResponseInterface

createHtmlResponse()

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
Response

createJsonErrorResponse()

protected createJsonErrorResponse(Throwable $e) : ResponseInterface
Parameters
$e : Throwable
Return values
ResponseInterface

createJsonResponse()

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
Response

createRedirectResponse()

protected createRedirectResponse(string $url[, int|null $code = null ]) : Response
Parameters
$url : string
$code : int|null = null
Return values
Response

getAccept()

protected getAccept(array<string|int, mixed> $compare) : mixed
Parameters
$compare : array<string|int, mixed>

getErrorJson()

protected getErrorJson(Throwable $e) : array<string|int, mixed>
Parameters
$e : Throwable
Return values
array<string|int, mixed>

getRequest()

protected abstract getRequest() : ServerRequestInterface
Return values
ServerRequestInterface

setMessage()

protected abstract setMessage(string $message[, string $type = 'info' ]) : $this
Parameters
$message : string
$type : string = 'info'
Return values
$this

        
On this page

Search results