Documentation

Node
in package
implements NodeInterface

FinalYes
Tags
author

Titouan Galopin galopintitouan@gmail.com

Table of Contents

Interfaces

NodeInterface
Represents the sanitized version of a DOM node in the sanitized tree.

Constants

VOID_ELEMENTS  = ['area' => true, 'base' => true, 'br' => true, 'col' => true, 'embed' => true, 'hr' => true, 'img' => true, 'input' => true, 'keygen' => true, 'link' => true, 'meta' => true, 'param' => true, 'source' => true, 'track' => true, 'wbr' => true]

Properties

$attributes  : array<string|int, mixed>
$children  : array<string|int, mixed>
$parent  : NodeInterface
$tagName  : string

Methods

__construct()  : mixed
addChild()  : void
Add a child node to this node.
getAttribute()  : string|null
getParent()  : NodeInterface|null
Return the parent node of this node, or null if it has no parent node.
render()  : string
Render this node as a string, recursively rendering its children as well.
setAttribute()  : void
renderAttributes()  : string

Constants

VOID_ELEMENTS

private mixed VOID_ELEMENTS = ['area' => true, 'base' => true, 'br' => true, 'col' => true, 'embed' => true, 'hr' => true, 'img' => true, 'input' => true, 'keygen' => true, 'link' => true, 'meta' => true, 'param' => true, 'source' => true, 'track' => true, 'wbr' => true]

Properties

$attributes

private array<string|int, mixed> $attributes = []

$children

private array<string|int, mixed> $children = []

$tagName

private string $tagName

Methods

getAttribute()

public getAttribute(string $name) : string|null
Parameters
$name : string
Return values
string|null

getParent()

Return the parent node of this node, or null if it has no parent node.

public getParent() : NodeInterface|null
Return values
NodeInterface|null

render()

Render this node as a string, recursively rendering its children as well.

public render() : string
Return values
string

setAttribute()

public setAttribute(string $name, string|null $value[, bool $override = false ]) : void
Parameters
$name : string
$value : string|null
$override : bool = false

renderAttributes()

private renderAttributes() : string
Return values
string

        
On this page

Search results