Interface Yiisoft\DataResponse\ResponseFactory\DataResponseFactoryInterface
Interface for factories that create HTTP responses with {@see DataStream} body.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| createResponse() | Creates an HTTP response with the given data wrapped in a {@see DataStream}. | Yiisoft\ |
Method Details
Creates an HTTP response with the given data wrapped in a {@see DataStream}.
| public abstract \ | ||
| $data | mixed |
The data to include in the response body. |
| $code | integer |
The HTTP status code. |
| $reasonPhrase | string |
The reason phrase. If empty, a default phrase for the status code will be used. |
| return | \ |
The created response with {@see \ |
|---|---|---|
public function createResponse(
mixed $data = null,
int $code = Status::OK,
string $reasonPhrase = '',
): ResponseInterface;
User Contributed Notes
Leave a comment
Join the conversation to share a note.