ResponseInterface
in
PHP Mini Framework
Tags
Table of Contents
- addHttpHeaders() : self
- addParameters() : self
- download() : self
- getBody() : StreamInterface|Stringable|resource|string|null
- getFormat() : string
- getHttpHeader() : mixed
- getHttpHeaders() : mixed
- getParameter() : mixed
- getParameters() : array<string|int, mixed>
- getStatusCode() : int
- getStatusText() : string
- html() : self
- isClientError() : bool
- isInformational() : bool
- isInvalid() : bool
- isRedirection() : bool
- isServerError() : bool
- isSuccessful() : bool
- json() : self
- redirect() : self
- Set Redirect Headers
- send() : mixed
- setBody() : self
- setFormat() : self
- setHttpHeader() : self
- setHttpHeaders() : self
- setParameter() : self
- setParameters() : self
- setStatusCode() : self
- toPsr() : ResponseInterface
- xml() : self
Methods
addHttpHeaders()
public
addHttpHeaders(array<string|int, mixed> $httpHeaders) : self
Parameters
- $httpHeaders : array<string|int, mixed>
Tags
Return values
self —addParameters()
public
addParameters(array<string|int, mixed> $parameters) : self
Parameters
- $parameters : array<string|int, mixed>
Tags
Return values
self —download()
public
download(StreamInterface|string|null $data[, string $name = null ][, bool $inline = false ][, string $contentType = null ]) : self
Parameters
- $data : StreamInterface|string|null
- $name : string = null
- $inline : bool = false
- $contentType : string = null
Tags
Return values
self —getBody()
public
getBody() : StreamInterface|Stringable|resource|string|null
Tags
Return values
StreamInterface|Stringable|resource|string|null —getFormat()
public
getFormat() : string
Tags
Return values
string —getHttpHeader()
public
getHttpHeader(string $name) : mixed
Parameters
- $name : string
Tags
Return values
mixed —getHttpHeaders()
public
getHttpHeaders() : mixed
Tags
Return values
mixed —getParameter()
public
getParameter(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
Tags
Return values
mixed —getParameters()
public
getParameters() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getStatusCode()
public
getStatusCode() : int
Tags
Return values
int —getStatusText()
public
getStatusText() : string
Tags
Return values
string —html()
public
html(StreamInterface|string|null $data[, int $code = 200 ]) : self
Parameters
- $data : StreamInterface|string|null
- $code : int = 200
-
response code
Tags
Return values
self —isClientError()
public
isClientError() : bool
Tags
Return values
bool —isInformational()
public
isInformational() : bool
Tags
Return values
bool —isInvalid()
public
isInvalid() : bool
Tags
Return values
bool —isRedirection()
public
isRedirection() : bool
Tags
Return values
bool —isServerError()
public
isServerError() : bool
Tags
Return values
bool —isSuccessful()
public
isSuccessful() : bool
Tags
Return values
bool —json()
public
json(array<string|int, mixed> $data[, int $code = 200 ]) : self
Parameters
- $data : array<string|int, mixed>
- $code : int = 200
-
response code
Tags
Return values
self —redirect()
Set Redirect Headers
public
redirect(string $uri[, int|false $refresh = false ]) : self
Parameters
- $uri : string
-
URL
- $refresh : int|false = false
-
Refresh page timeout. False to disable refresh redirect
Tags
Return values
self —send()
public
send([bool $continue = false ]) : mixed
Parameters
- $continue : bool = false
Tags
Return values
mixed —setBody()
public
setBody(StreamInterface|Stringable|resource|string|null $body) : self
Parameters
- $body : StreamInterface|Stringable|resource|string|null
Tags
Return values
self —setFormat()
public
setFormat([string $format = ResponseFormat::JSON ]) : self
Parameters
- $format : string = ResponseFormat::JSON
Tags
Return values
self —setHttpHeader()
public
setHttpHeader(string $name, mixed $value) : self
Parameters
- $name : string
- $value : mixed
Tags
Return values
self —setHttpHeaders()
public
setHttpHeaders(array<string|int, mixed> $httpHeaders) : self
Parameters
- $httpHeaders : array<string|int, mixed>
Tags
Return values
self —setParameter()
public
setParameter(string $name, mixed $value) : self
Parameters
- $name : string
- $value : mixed
Tags
Return values
self —setParameters()
public
setParameters(array<string|int, mixed> $parameters) : self
Parameters
- $parameters : array<string|int, mixed>
Tags
Return values
self —setStatusCode()
public
setStatusCode(mixed $statusCode[, mixed $text = null ]) : self
Parameters
- $statusCode : mixed
- $text : mixed = null
Tags
Return values
self —toPsr()
public
toPsr() : ResponseInterface
Tags
Return values
ResponseInterface —xml()
public
xml(array<string|int, mixed> $data[, int $code = 200 ]) : self
Parameters
- $data : array<string|int, mixed>
- $code : int = 200
-
response code