PHP Class Zend\Diactoros\Response\HtmlResponse

Allows creating a response by passing an HTML string to the constructor; by default, sets a status code of 200 and sets the Content-Type header to text/html.
Inheritance: extends Zend\Diactoros\Response
Show file Open project: zendframework/zend-diactoros Class Usage Examples

Public Methods

Method Description
__construct ( string | Psr\Http\Message\StreamInterface $html, integer $status = 200, array $headers = [] ) Create an HTML response.

Private Methods

Method Description
createBody ( string | Psr\Http\Message\StreamInterface $html ) : Psr\Http\Message\StreamInterface Create the message body.

Method Details

__construct() public method

Produces an HTML response with a Content-Type of text/html and a default status of 200.
public __construct ( string | Psr\Http\Message\StreamInterface $html, integer $status = 200, array $headers = [] )
$html string | Psr\Http\Message\StreamInterface HTML or stream for the message body.
$status integer Integer status code for the response; 200 by default.
$headers array Array of headers to use at initialization.