Pneuma Framework

Response extends Response
in package
implements ResponseInterface

Simple Response Implementation.

Table of Contents

Interfaces

ResponseInterface
Describes Response interface.

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.
file()  : static
Return an instance with provided file response.
response()  : static
Generate PSR-7 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
static

fileInline()

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
static

html()

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
static

json()

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
static

plain()

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
static

redirect()

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
static

xml()

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

Return values
static

file()

Return an instance with provided file response.

private file(string $disposition, string $path[, string $filename = '' ]) : static
Parameters
$disposition : string

Disposition type

$path : string

File path

$filename : string = ''

Filename

Return values
static

response()

Generate PSR-7 response.

private response(string $body[, int $status = 200 ][, array<string, string> $header = [] ]) : static
Parameters
$body : string

Response content

$status : int = 200

Response status

$header : array<string, string> = []

Response header

Return values
static

        
On this page

Search results