Skip to content
Thomas Weinert edited this page Jul 12, 2018 · 3 revisions

FluentDOM\Nodes::$document

The FluentDOM\Nodes::$document property provides access to the associated DOMDocument. By default this will be a FluentDOM\DOM\Document instance, but it depends on how you created the FluentDOM\Nodes instance.

$fd = new FluentDOM\Nodes();
$fd->document->appendChild(
  $fd->document->createElement('example')
);
echo $fd;

Output:

<?xml version="1.0" encoding="UTF-8"?>
<example/>
Clone this wiki locally