PrototypeNode
Tags
Table of Contents
- cleanWhitespace() : PrototypeNode
- Removes all of element's child text nodes that contain only whitespace. Returns element.
- empty() : bool
- Tests whether element is empty (i.e., contains only whitespace).
- importNode() : PrototypeNode
- Imports a new node into the document
- inspect() : string
- Returns the debug-oriented string representation of element.
- match() : bool
- Checks if element matches the given CSS selector.
- name() : string
- Returns the node name (convenience method)
- purge() : PrototypeNode
- Removes all child elements from the current element (not to confuse with the prototype method of the same name)
- recursivelyCollect() : NodeList
- Recursively collects elements whose relationship to element is specified by property.
- removeNode() : PrototypeNode
- Completely removes element from the document and returns it.
- replace() : PrototypeNode
- Replaces element itself with newContent and returns element.
- value() : string
- Returns the node value, optionally trims whitespace (default)
Methods
cleanWhitespace()
Removes all of element's child text nodes that contain only whitespace. Returns element.
public
cleanWhitespace() : PrototypeNode
Tags
Return values
PrototypeNode —empty()
Tests whether element is empty (i.e., contains only whitespace).
public
empty() : bool
Tags
Return values
bool —importNode()
Imports a new node into the document
public
importNode(PrototypeNode $newNode) : PrototypeNode
Parameters
- $newNode : PrototypeNode
Return values
PrototypeNode —inspect()
Returns the debug-oriented string representation of element.
public
inspect([bool $xml = null ]) : string
Parameters
- $xml : bool = null
Tags
Return values
string —match()
Checks if element matches the given CSS selector.
public
match(string $selector) : bool
Parameters
- $selector : string
Tags
Return values
bool —name()
Returns the node name (convenience method)
public
name() : string
Return values
string —purge()
Removes all child elements from the current element (not to confuse with the prototype method of the same name)
public
purge() : PrototypeNode
Return values
PrototypeNode —recursivelyCollect()
Recursively collects elements whose relationship to element is specified by property.
public
recursivelyCollect(string $property[, int $maxLength = null ][, int $nodeType = null ]) : NodeList
property has to be a property of element that points to a single DOM node (e.g., nextSibling or parentNode).
Parameters
- $property : string
- $maxLength : int = null
- $nodeType : int = null
Tags
Return values
NodeList —removeNode()
Completely removes element from the document and returns it.
public
removeNode() : PrototypeNode
Tags
Return values
PrototypeNode —replace()
Replaces element itself with newContent and returns element.
public
replace(PrototypeNode $newNode) : PrototypeNode
Parameters
- $newNode : PrototypeNode
Tags
Return values
PrototypeNode —value()
Returns the node value, optionally trims whitespace (default)
public
value([bool $trimmed = true ]) : string
Parameters
- $trimmed : bool = true