Zend Framework
3.0
|
Plain text response. More...
Public Member Functions | |
__construct ($text, $status=200, array $headers=[]) | |
Create a plain text response. | |
Public Member Functions inherited from Response | |
__construct ($body= 'php://memory', $status=200, array $headers=[]) | |
getStatusCode () | |
{} | |
getReasonPhrase () | |
{} | |
withStatus ($code, $reasonPhrase= '') | |
{} | |
Plain text response.
Allows creating a response by passing a string to the constructor; by default, sets a status code of 200 and sets the Content-Type header to text/plain.
__construct | ( | $text, | |
$status = 200 , |
|||
array | $headers = [] |
||
) |
Create a plain text response.
Produces a text response with a Content-Type of text/plain and a default status of 200.
string | StreamInterface | $text | String or stream for the message body. |
int | $status | Integer status code for the response; 200 by default. |
array | $headers | Array of headers to use at initialization. |
InvalidArgumentException | if $text is neither a string or stream. |