public function HTML5::saveHTML in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/masterminds/html5/src/HTML5.php \Masterminds\HTML5::saveHTML()
Convert a DOM into an HTML5 string.
Parameters
mixed $dom: The DOM to be serialized.
array $options: Configuration options when serializing the DOM. These include:
- encode_entities: Text written to the output is escaped by default and not all
entities are encoded. If this is set to true all entities will be encoded. Defaults to false.
Return value
string A HTML5 documented generated from the DOM.
File
- vendor/
masterminds/ html5/ src/ HTML5.php, line 243
Class
- HTML5
- This class offers convenience methods for parsing and serializing HTML5. It is roughly designed to mirror the \DOMDocument class that is provided with most versions of PHP.
Namespace
MastermindsCode
public function saveHTML($dom, $options = array()) {
$stream = fopen('php://temp', 'w');
$this
->save($dom, $stream, array_merge($this
->getOptions(), $options));
return stream_get_contents($stream, -1, 0);
}