Skip to content
Thomas Weinert edited this page Jul 30, 2014 · 2 revisions

FluentDOM\Nodes::$contentType

The FluentDOM\Nodes::$contentType specifies if the mode is set to text/xml or text/html. This has effect on saving the document and will be set by the loader.

$fd = new FluentDOM\Nodes(
  '<div>Hello World!<br/></div>', 'text/xml'
);
echo $fd, "\n";
$fd->contentType = 'text/html';
echo $fd;

Output:

<?xml version="1.0"?>
<div>Hello World!<br/></div>

<div>Hello World!<br></div>

See also: FluentDOM\Nodes::load()

Clone this wiki locally