AMP_DOM_Utils::create_node

AMP_DOM_Utils::create_node( AmpProjectDomDocument $dom,  string $tag,  string[] $attributes )

Description #

Create a new node w/attributes (a DOMElement) and add to the passed Dom\Document.


Parameters #

$dom

(AmpProjectDomDocument) (Required) A representation of an HTML document to add the new node to.

$tag

(string) (Required) A valid HTML element tag for the element to be added.

$attributes

(string[]) (Required) One of more valid attributes for the new node.


Return #

(DOMElement|false) The DOMElement for the given $tag, or false on failure


Changelog #

Changelog
Version Description
0.2 Introduced.