class Output implements OutputInterface (View source)

Standard output object for PHP SAPI.

Properties

string $headerSent Property headerSent.

Methods

ResponseInterface
respond(ResponseInterface $response, boolean $returnBody = false)

Method to send the application response to the client. All headers will be sent prior to the main application output data.

string
sendBody(ResponseInterface $response)

Method to send the application response to the client. All headers will be sent prior to the main application output data.

header(string $string, boolean $replace = true, integer $code = null)

Method to send a header to the client. We wrap header() function with this method for testing reason.

sendHeaders(ResponseInterface $response)

Send all response headers.

void
sendStatusLine(ResponseInterface $response)

Send HTTP status line.

bool
headersSent()

checkHeaderSent

Details

at line line 40
ResponseInterface respond(ResponseInterface $response, boolean $returnBody = false)

Method to send the application response to the client. All headers will be sent prior to the main application output data.

Parameters

ResponseInterface $response Respond body output.
boolean $returnBody Return body as string.

Return Value

ResponseInterface

at line line 66
string sendBody(ResponseInterface $response)

Method to send the application response to the client. All headers will be sent prior to the main application output data.

Parameters

ResponseInterface $response Emmit string to respond.

Return Value

string

at line line 84
Output header(string $string, boolean $replace = true, integer $code = null)

Method to send a header to the client. We wrap header() function with this method for testing reason.

Parameters

string $string The header string.
boolean $replace The optional replace parameter indicates whether the header should replace a previous similar header, or add a second header of the same type.
integer $code Forces the HTTP response code to the specified value. Note that this parameter only has an effect if the string is not empty.

Return Value

Output Return self to support chaining.

See also

header()

at line line 98
Output sendHeaders(ResponseInterface $response)

Send all response headers.

Parameters

ResponseInterface $response Response object to contain headers.

Return Value

Output Instance of $this to allow chaining.

at line line 123
void sendStatusLine(ResponseInterface $response)

Send HTTP status line.

Parameters

ResponseInterface $response Response object to contain status code and protocol version.

Return Value

void

at line line 137
bool headersSent()

checkHeaderSent

Return Value

bool