Properties

$childNodes

$childNodes : array

Object child nodes

Type

array

$indent

$indent : string

Indentation for formatting purposes

Type

string

$output

$output : string

Child output

Type

string

$nodeName

$nodeName : string

Child element node name

Type

string

$nodeValue

$nodeValue : string

Child element node value

Type

string

$cData

$cData : boolean

Child element node value CDATA flag

Type

boolean

$childrenFirst

$childrenFirst : boolean

Flag to render children before node value or not

Type

boolean

$attributes

$attributes : array

Child element attributes

Type

array

$preserveWhiteSpace

$preserveWhiteSpace : boolean

Flag to preserve whitespace

Type

boolean

Methods

getIndent()

getIndent() : string

Return the indent

Returns

string

setIndent()

setIndent(string  $indent) : mixed

Set the indent

Parameters

string $indent

Returns

mixed

addChild()

addChild(mixed  $c) : mixed

Add a child to the object

Parameters

mixed $c

Throws

\InvalidArgumentException

Returns

mixed

addChildren()

addChildren(  $children) : mixed

Add children to the object

Parameters

$children

Throws

\Pop\Dom\Exception

Returns

mixed

hasChildren()

hasChildren() : boolean

Get whether or not the child object has children

Returns

boolean

hasChildNodes()

hasChildNodes() : boolean

Get whether or not the child object has children (alias)

Returns

boolean

getChild()

getChild(integer  $i) : \Pop\Dom\Child

Get the child nodes of the object

Parameters

integer $i

Returns

\Pop\Dom\Child

getChildren()

getChildren() : array

Get the child nodes of the object

Returns

array

getChildNodes()

getChildNodes() : array

Get the child nodes of the object (alias)

Returns

array

removeChild()

removeChild(integer  $i) : void

Remove all child nodes from the object

Parameters

integer $i

removeChildren()

removeChildren() : void

Remove all child nodes from the object

__construct()

__construct(string  $name, string  $value = null, array  $options = array()) 

Constructor

Instantiate the DOM element object

Parameters

string $name
string $value
array $options

create()

create(string  $name, string  $value = null, array  $options = array()) : \Pop\Dom\Child

Static factory method to create a child object

Parameters

string $name
string $value
array $options

Returns

\Pop\Dom\Child

parseString()

parseString(string  $string) : \Pop\Dom\Child|array

Static method to parse an XML/HTML string

Parameters

string $string

Returns

\Pop\Dom\Child|array

parseFile()

parseFile(string  $file) : \Pop\Dom\Child

Static method to parse an XML/HTML string from a file

Parameters

string $file

Throws

\Pop\Dom\Exception

Returns

\Pop\Dom\Child

getNodeName()

getNodeName() : string

Return the child node name

Returns

string

getNodeValue()

getNodeValue() : string

Return the child node value

Returns

string

getNodeContent()

getNodeContent(boolean  $ignoreWhiteSpace = false) : string

Return the child node content, including tags, etc

Parameters

boolean $ignoreWhiteSpace

Returns

string

getTextContent()

getTextContent(boolean  $ignoreWhiteSpace = false) : string

Return the child node content, including tags, etc

Parameters

boolean $ignoreWhiteSpace

Returns

string

setNodeName()

setNodeName(string  $name) : \Pop\Dom\Child

Set the child node name

Parameters

string $name

Returns

\Pop\Dom\Child

setNodeValue()

setNodeValue(string  $value) : \Pop\Dom\Child

Set the child node value

Parameters

string $value

Returns

\Pop\Dom\Child

addNodeValue()

addNodeValue(string  $value) : \Pop\Dom\Child

Add to the child node value

Parameters

string $value

Returns

\Pop\Dom\Child

setAsCData()

setAsCData(boolean  $cData = true) : \Pop\Dom\Child

Set the child node value as CDATA

Parameters

boolean $cData

Returns

\Pop\Dom\Child

isCData()

isCData() : boolean

Determine if the child node value is CDATA

Returns

boolean

setAttribute()

setAttribute(string  $a, string  $v) : \Pop\Dom\Child

Set an attribute for the child element object

Parameters

string $a
string $v

Returns

\Pop\Dom\Child

setAttributes()

setAttributes(array  $a) : \Pop\Dom\Child

Set an attribute or attributes for the child element object

Parameters

array $a

Returns

\Pop\Dom\Child

hasAttribute()

hasAttribute(string  $name) : boolean

Determine if the child object has an attribute

Parameters

string $name

Returns

boolean

getAttribute()

getAttribute(string  $name) : string

Get the attribute of the child object

Parameters

string $name

Returns

string

getAttributes()

getAttributes() : array

Get the attributes of the child object

Returns

array

removeAttribute()

removeAttribute(string  $a) : \Pop\Dom\Child

Remove an attribute from the child element object

Parameters

string $a

Returns

\Pop\Dom\Child

isChildrenFirst()

isChildrenFirst() : boolean

Determine if child nodes render first, before the node value

Returns

boolean

setChildrenFirst()

setChildrenFirst(boolean  $first = true) : \Pop\Dom\Child

Set whether child nodes render first, before the node value

Parameters

boolean $first

Returns

\Pop\Dom\Child

preserveWhiteSpace()

preserveWhiteSpace(boolean  $preserve = true) : \Pop\Dom\Child

Set whether to preserve whitespace

Parameters

boolean $preserve

Returns

\Pop\Dom\Child

render()

render(integer  $depth, string  $indent = null, boolean  $inner = false) : mixed

Render the child and its child nodes.

Parameters

integer $depth
string $indent
boolean $inner

Returns

mixed

__toString()

__toString() : string

Render Dom child object to string

Returns

string