PHP Class Pop\Dom\Child

Author: Nick Sagona, III ([email protected])
Inheritance: extends Pop\Dom\AbstractNode
Show file Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$attributes array Child element attributes
$childrenFirst boolean Flag to render children before node value or not.
$nodeName string Child element node name
$nodeValue string Child element node value

Public Methods

Method Description
__construct ( string $name, string $value = null, mixed $childNode = null, boolean $first = false, string $indent = null ) : Child Constructor
__toString ( ) : string Render Dom child object to string
factory ( array $c ) : Child Static factory method to create child objects
getAttribute ( string $name ) : string Get the attribute of the child object.
getAttributes ( ) : array Get the attributes of the child object.
getNodeName ( ) : string Method to return the child node name.
getNodeValue ( ) : string Method to return the child node value.
render ( boolean $ret = false, integer $depth, string $indent = null ) : void Method to render the child and its child nodes.
setAttributes ( array | string $a, string $v = null ) : Child Set an attribute or attributes for the child element object.
setNodeName ( string $name ) : Child Method to set the child node name.
setNodeValue ( string $value ) : Child Method to set the child node value.

Method Details

__construct() public method

Instantiate the form element object
public __construct ( string $name, string $value = null, mixed $childNode = null, boolean $first = false, string $indent = null ) : Child
$name string
$value string
$childNode mixed
$first boolean
$indent string
return Child

__toString() public method

Render Dom child object to string
public __toString ( ) : string
return string

factory() public static method

Static factory method to create child objects
public static factory ( array $c ) : Child
$c array
return Child

getAttribute() public method

Get the attribute of the child object.
public getAttribute ( string $name ) : string
$name string
return string

getAttributes() public method

Get the attributes of the child object.
public getAttributes ( ) : array
return array

getNodeName() public method

Method to return the child node name.
public getNodeName ( ) : string
return string

getNodeValue() public method

Method to return the child node value.
public getNodeValue ( ) : string
return string

render() public method

Method to render the child and its child nodes.
public render ( boolean $ret = false, integer $depth, string $indent = null ) : void
$ret boolean
$depth integer
$indent string
return void

setAttributes() public method

Set an attribute or attributes for the child element object.
public setAttributes ( array | string $a, string $v = null ) : Child
$a array | string
$v string
return Child

setNodeName() public method

Method to set the child node name.
public setNodeName ( string $name ) : Child
$name string
return Child

setNodeValue() public method

Method to set the child node value.
public setNodeValue ( string $value ) : Child
$value string
return Child

Property Details

$attributes protected property

Child element attributes
protected array $attributes
return array

$childrenFirst protected property

Flag to render children before node value or not.
protected bool $childrenFirst
return boolean

$nodeName protected property

Child element node name
protected string $nodeName
return string

$nodeValue protected property

Child element node value
protected string $nodeValue
return string