ResponseInterface
extends
ResponseInterface
in
Describes Response interface.
Table of Contents
Methods
- fileAttachment() : static
- Return an instance with provided attachment disposition response.
- fileInline() : static
- Return an instance with provided inline disposition response.
- html() : static
- Return an instance with provided text/html response.
- json() : static
- Return an instance with provided application/json response.
- plain() : static
- Return an instance with provided text/plain response.
- redirect() : static
- Return an instance with provided redirect response.
- xml() : static
- Return an instance with provided text/xml response.
Methods
fileAttachment()
Return an instance with provided attachment disposition response.
public
fileAttachment(string $path[, string $filename = '' ]) : static
Parameters
- $path : string
-
File path
- $filename : string = ''
-
Filename
Return values
staticfileInline()
Return an instance with provided inline disposition response.
public
fileInline(string $path[, string $filename = '' ]) : static
Parameters
- $path : string
-
File path
- $filename : string = ''
-
Filename
Return values
statichtml()
Return an instance with provided text/html response.
public
html(string $markUp[, int $status = 200 ]) : static
Parameters
- $markUp : string
-
Response content
- $status : int = 200
-
Response status
Return values
staticjson()
Return an instance with provided application/json response.
public
json(array<string|int, mixed> $data[, bool $prettyPrint = false ][, int $status = 200 ]) : static
Parameters
- $data : array<string|int, mixed>
-
Response content
- $prettyPrint : bool = false
-
Response pretty print
- $status : int = 200
-
Response status
Return values
staticplain()
Return an instance with provided text/plain response.
public
plain(string $text[, int $status = 200 ]) : static
Parameters
- $text : string
-
Response content
- $status : int = 200
-
Response status
Return values
staticredirect()
Return an instance with provided redirect response.
public
redirect(string $url[, bool $permanent = false ]) : static
Parameters
- $url : string
-
Location redirect
- $permanent : bool = false
-
Permanent redirect
Return values
staticxml()
Return an instance with provided text/xml response.
public
xml(SimpleXMLElement $xml[, int $status = 200 ]) : static
Parameters
- $xml : SimpleXMLElement
-
Response content
- $status : int = 200
-
Response status