Properties

$nodeName

$nodeName : string

Child element node name

Type

string

$nodeValue

$nodeValue : string

Child element node value

Type

string

$childrenFirst

$childrenFirst : boolean

Flag to render children before node value or not

Type

boolean

$attributes

$attributes : array

Child element attributes

Type

array

$childNodes

$childNodes : array

Object child nodes

Type

array

$indent

$indent : string

Indentation for formatting purposes

Type

string

$output

$output : string

Child output

Type

string

Methods

__construct()

__construct(string  $value, string  $nodeValue, array  $options = array()) 

Constructor

Instantiate the option element object

Parameters

string $value
string $nodeValue
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

getNodeName()

getNodeName() : string

Return the child node name

Returns

string

getNodeValue()

getNodeValue() : string

Return the child node value

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

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) : string

Set whether child nodes render first, before the node value

Parameters

boolean $first

Returns

string

render()

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

Render the child and its child nodes.

Parameters

integer $depth
string $indent

Returns

mixed

__toString()

__toString() : string

Render Dom child object to string

Returns

string

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(array  $c) : mixed

Add children to the object

Parameters

array $c

Throws

\Pop\Dom\Exception

Returns

mixed

hasChildren()

hasChildren() : boolean

Get whether or not the child object has children

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

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

getValue()

getValue() : string

Get the option value

Returns

string

isSelected()

isSelected() : boolean

Determine if the option value is selected

Returns

boolean