XML
Less than 1 minute
XML
XML response class.
class XML extends \Hazaar\Controller\ResponseExtends: Hazaar\Controller\Response
This response type encapsulates an Hazaar\XML\Element document and emits it as XML over HTTP with a text/xml content type. It validates assigned payloads to ensure only framework XML element instances are accepted.
Properties
xmlContent
public Element $xmlContentType: Hazaar\XML\Element
Methods
__construct
Create a new XML response.
public __construct(?Element $content, int $status = 200): voidParameters
| Parameter | Type | Description |
|---|---|---|
$content | Hazaar\XML\Element | optional XML document payload |
$status | int | HTTP status code |
content
Set XML payload content for the response.
public content(mixed $content): selfReturns: self
Parameters
| Parameter | Type | Description |
|---|---|---|
$content | mixed | XML payload expected to be an Hazaar\XML\Element instance |
getContent
Render and return XML response content.
public getContent(): stringReturns: string
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000