PHP 클래스 Zend\Diactoros\Response\TextResponse

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.
상속: extends Zend\Diactoros\Response, use trait InjectContentTypeTrait
파일 보기 프로젝트 열기: zendframework/zend-diactoros

공개 메소드들

메소드 설명
__construct ( string | Psr\Http\Message\StreamInterface $text, integer $status = 200, array $headers = [] ) Create a plain text response.

비공개 메소드들

메소드 설명
createBody ( string | Psr\Http\Message\StreamInterface $text ) : Psr\Http\Message\StreamInterface Create the message body.

메소드 상세

__construct() 공개 메소드

Produces a text response with a Content-Type of text/plain and a default status of 200.
public __construct ( string | Psr\Http\Message\StreamInterface $text, integer $status = 200, array $headers = [] )
$text string | Psr\Http\Message\StreamInterface String 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.