Constants

XML

XML

Constant to use the XML doctype

HTML

HTML

Constant to use the HTML doctype

RSS

RSS

Constant to use the XML doctype, RSS content-type

ATOM

ATOM

Constant to use the XML doctype, Atom content-type

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

$doctype

$doctype : string

Document type

Type

string

$contentType

$contentType : string

Document content type

Type

string

$charset

$charset : string

Document charset

Type

string

$doctypes

$doctypes : array

Document doctypes

Type

array

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  $doctype = 'XML', \Pop\Dom\Child  $childNode = null, string  $indent = null) 

Constructor

Instantiate the document object

Parameters

string $doctype
\Pop\Dom\Child $childNode
string $indent

getDoctype()

getDoctype() : string

Return the document type.

Returns

string

getCharset()

getCharset() : string

Return the document charset

Returns

string

getContentType()

getContentType() : string

Return the document charset

Returns

string

setDoctype()

setDoctype(string  $doctype) : \Pop\Dom\Document

Set the document type

Parameters

string $doctype

Throws

\Pop\Dom\Exception

Returns

\Pop\Dom\Document

setCharset()

setCharset(string  $char) : \Pop\Dom\Document

Set the document charset

Parameters

string $char

Returns

\Pop\Dom\Document

setContentType()

setContentType(string  $content) : \Pop\Dom\Document

Set the document charset

Parameters

string $content

Returns

\Pop\Dom\Document

render()

render() : string

Render the document and its child elements

Returns

string

__toString()

__toString() : string

Render Dom object to string

Returns

string