Constants

HTML_TRANS

HTML_TRANS

Constant to use the HTML trans doctype

HTML_STRICT

HTML_STRICT

Constant to use HTML strict doctype

HTML_FRAMES

HTML_FRAMES

Constant to use the HTML frames doctype

XHTML_TRANS

XHTML_TRANS

Constant to use the XHTML trans doctype

XHTML_STRICT

XHTML_STRICT

Constant to use the XHTML strict doctype

XHTML_FRAMES

XHTML_FRAMES

Constant to use the XHTML frames doctype

XHTML11

XHTML11

Constant to use the XHTML 1.1 doctype

XML

XML

Constant to use the XML doctype

HTML5

HTML5

Constant to use the HTML5 doctype

RSS

RSS

Constant to use the RSS doctype

ATOM

ATOM

Constant to use the ATOM doctype

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(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.

__construct()

__construct(string  $doctype = null, mixed  $childNode = null, string  $indent = null) : \Pop\Dom\Document

Constructor

Instantiate the document object

Parameters

string $doctype
mixed $childNode
string $indent

Returns

\Pop\Dom\Document

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 = null) : \Pop\Dom\Document

Set the document type.

Parameters

string $doctype

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(boolean  $ret = false) : mixed

Render the document and its child elements.

Parameters

boolean $ret

Returns

mixed

__toString()

__toString() : string

Render Dom object to string

Returns

string