Xml
extends Base
in package
implements
Document
Render XML output.
Interfaces, Classes, Traits and Enums
- Document
- A Document is a standalone component, that can't be wrapped inside another component.
Table of Contents
- $formatOutput : bool
- $xml : SimpleXMLElement|DOMDocument|array<string|int, mixed>|string
- __construct() : mixed
- build() : SimpleXMLElement
- Convert an array or object to a SimpleXMLElement.
- getHeaders() : array<string|int, mixed>
- The headers for this type of document.
- isDocument() : bool
- Determines if the component is a Document.
- render() : mixed
- addNodes() : mixed
Properties
$formatOutput
private
bool
$formatOutput
Format XML with indentation and validates the XML.
$xml
private
SimpleXMLElement|DOMDocument|array<string|int, mixed>|string
$xml
Methods
__construct()
public
__construct(mixed $xml[, mixed $formatOutput = true ]) : mixed
Parameters
- $xml : mixed
- $formatOutput : mixed = true
Return values
mixed —build()
Convert an array or object to a SimpleXMLElement.
public
static build(array<string|int, mixed>|object $data[, mixed $charset = 'UTF-8' ]) : SimpleXMLElement
Parameters
- $data : array<string|int, mixed>|object
- $charset : mixed = 'UTF-8'
Return values
SimpleXMLElement —getHeaders()
The headers for this type of document.
public
getHeaders() : array<string|int, mixed>
Must include 'http' headers.
Return values
array<string|int, mixed> —isDocument()
Determines if the component is a Document.
public
isDocument() : bool
This allows errors to be wrapped in a layout.
Return values
bool —render()
public
render() : mixed
Return values
mixed —addNodes()
private
static addNodes(SimpleXMLElement $xml, array<string|int, mixed> $data, mixed $node[, mixed $detectEncoding = false ]) : mixed
Parameters
- $xml : SimpleXMLElement
- $data : array<string|int, mixed>
- $node : mixed
- $detectEncoding : mixed = false