Domovoy API

HtmlRenderer
in package
implements Renderer uses HtmlAttributeRenderer

FinalYes

Renders a node tree into an HTML5 string.

Supports compact (default) and pretty-printed output. Handles text escaping, boolean attributes, void elements, and IDL-to-HTML name mapping (e.g. classNameclass).

Table of Contents

Interfaces

Renderer
Renders a node tree into a complete string.

Properties

$indentation  : string|null
$nameCache  : array<class-string, array<string, string>>
$nestedCache  : array<NodeAttributes>, array<int, string>>

Methods

__construct()  : mixed
render()  : string
isSingleTextChild()  : bool
renderAttributes()  : string
renderChildren()  : string
renderNode()  : string
renderObjectProperties()  : array<int, string>
resolveHtmlNames()  : array<string, string>
resolveNestedNames()  : array<int, string>

Properties

$indentation read-only

private string|null $indentation = null

Methods

__construct()

public __construct([string|null $indentation = null ]) : mixed
Parameters
$indentation : string|null = null

Indentation string for pretty-print (e.g. ' ' or "\t"). Null for compact output.

render()

public render(Node $node) : string
Parameters
$node : Node
Return values
string

isSingleTextChild()

private isSingleTextChild(array<int, Node$childNodes) : bool
Parameters
$childNodes : array<int, Node>
Return values
bool

renderAttributes()

private renderAttributes(Node $node) : string
Parameters
$node : Node
Return values
string

renderNode()

private renderNode(Node $node, int $depth) : string
Parameters
$node : Node
$depth : int
Return values
string

renderObjectProperties()

private renderObjectProperties(object $object) : array<int, string>
Parameters
$object : object
Return values
array<int, string>

resolveHtmlNames()

private resolveHtmlNames(object $attributes) : array<string, string>
Parameters
$attributes : object
Return values
array<string, string>

Map of IDL property name to HTML attribute name


        
On this page

Search results