final class tidyNode (View source)

An HTML node in an HTML file, as detected by tidy.

Properties

string $value

The HTML representation of the node, including the surrounding tags.

string $name

The name of the HTML node

int $type

The type of the tag (one of the constants above, e.g. ```TIDY_NODETYPE_PHP```)

int $line

The line number at which the tags is located in the file

int $column

The column number at which the tags is located in the file

bool $proprietary

Indicates if the node is a proprietary tag

int|null $id

The ID of the tag (one of the constants above, e.g. ```TIDY_TAG_FRAME```)

array|null $attribute

An array of string, representing the attributes names (as keys) of the current node.

array|null $child

An array of tidyNode, representing the children of the current node.

Methods

bool
hasChildren()

Checks if a node has children

bool
hasSiblings()

Checks if a node has siblings

bool
isComment()

Checks if a node represents a comment

bool
isHtml()

Checks if a node is part of a HTML document

bool
isText()

Checks if a node represents text (no markup)

bool
isJste()

Checks if this node is JSTE

bool
isAsp()

Checks if this node is ASP

bool
isPhp()

Checks if a node is PHP

tidyNode|null
getParent()

Returns the parent node of the current node

Details

bool hasChildren()

Since: 5.0.1

Checks if a node has children

Return Value

bool

TRUE if the node has children, FALSE otherwise.

bool hasSiblings()

Since: 5.0.1

Checks if a node has siblings

Return Value

bool

TRUE if the node has siblings, FALSE otherwise.

bool isComment()

Since: 5.0.1

Checks if a node represents a comment

Return Value

bool

TRUE if the node is a comment, FALSE otherwise.

bool isHtml()

Since: 5.0.1

Checks if a node is part of a HTML document

Return Value

bool

TRUE if the node is part of a HTML document, FALSE otherwise.

bool isText()

Since: 5.0.1

Checks if a node represents text (no markup)

Return Value

bool

TRUE if the node represent a text, FALSE otherwise.

bool isJste()

Since: 5.0.1

Checks if this node is JSTE

Return Value

bool

TRUE if the node is JSTE, FALSE otherwise.

bool isAsp()

Since: 5.0.1

Checks if this node is ASP

Return Value

bool

TRUE if the node is ASP, FALSE otherwise.

bool isPhp()

Since: 5.0.1

Checks if a node is PHP

Return Value

bool

TRUE if the current node is PHP code, FALSE otherwise.

tidyNode|null getParent()

Since: 5.2.2

Returns the parent node of the current node

Return Value

tidyNode|null

a tidyNode if the node has a parent, or NULL otherwise.