function 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 235
Class
- HTML5
- This class offers convenience methods for parsing and serializing HTML5. It is roughly designed to mirror the \DOMDocument native class.
Namespace
MastermindsCode
public function saveHTML($dom, $options = array()) {
$stream = fopen('php://temp', 'wb');
$this->save($dom, $stream, array_merge($this->defaultOptions, $options));
$html = stream_get_contents($stream, -1, 0);
fclose($stream);
return $html;
}