Text
Less than 1 minute
Text
Plain text response class.
class Text extends \Hazaar\Controller\Response\ResponseThis response type represents text-based HTTP output and configures the Content-Type header as text/plain. It optionally accepts initial content and allows callers to specify the HTTP status code.
It is typically used for diagnostics, CLI-like endpoint output, or other non-HTML/non-JSON textual responses.
Methods
__construct
Create a new plain text response.
public __construct(?string $content, int $status = 200): voidInitializes the response with text/plain content type and applies the provided content and status code.
Parameters
| Parameter | Type | Description |
|---|---|---|
$content | string | optional response body content |
$status | int | HTTP status code for the response |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000