ResponseInterface
in
PHP Mini Framework
Tags
Table of Contents
- addHttpHeaders() : self
- addParameters() : self
- getBody() : StreamInterface|string
- getHttpHeader() : mixed
- getHttpHeaders() : mixed
- getParameter() : mixed
- getParameters() : array<string|int, mixed>
- getStatusCode() : int
- getStatusText() : string
- html() : self|null
- isClientError() : bool
- isInformational() : bool
- isInvalid() : bool
- isRedirection() : bool
- isServerError() : bool
- isSuccessful() : bool
- json() : self|null
- redirect() : self
- Header Redirect
- send() : mixed
- setBody() : self
- setHttpHeader() : self
- setHttpHeaders() : self
- setParameter() : self
- setParameters() : self
- setStatusCode() : self
- xml() : self|null
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 —getBody()
public
getBody() : StreamInterface|string
Tags
Return values
StreamInterface|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 ][, bool $continue = false ]) : self|null
Parameters
- $data : StreamInterface|string|null
- $code : int = 200
-
response code
- $continue : bool = false
Tags
Return values
self|null —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 ][, bool $continue = false ]) : self|null
Parameters
- $data : array<string|int, mixed>
- $code : int = 200
-
response code
- $continue : bool = false
Tags
Return values
self|null —redirect()
Header Redirect
public
redirect(string $uri[, string $method = 'auto' ][, int $code = NULL ]) : self
Parameters
- $uri : string
-
URL
- $method : string = 'auto'
-
Redirect method 'auto', 'location' or 'refresh'
- $code : int = NULL
-
HTTP Response status code
Tags
Return values
self —send()
public
send([string $format = ResponseFormat::JSON ][, bool $continue = false ]) : mixed
Parameters
- $format : string = ResponseFormat::JSON
-
@see \Busarm\PhpMini\Enums\ResponseFormat
- $continue : bool = false
Tags
Return values
mixed —setBody()
public
setBody(StreamInterface|string $body) : self
Parameters
- $body : StreamInterface|string
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(int $statusCode[, string $text = null ]) : self
Parameters
- $statusCode : int
- $text : string = null
Tags
Return values
self —xml()
public
xml(array<string|int, mixed> $data[, int $code = 200 ][, bool $continue = false ]) : self|null
Parameters
- $data : array<string|int, mixed>
- $code : int = 200
-
response code
- $continue : bool = false