/** * {@inheritdoc} */ public function dump(Template $template) { $metadata = $template->getMetadata(); $dom = $template->getDocument(); $html5 = $this->getHtml5(); return $html5->saveHTML($metadata['fragment'] ? $dom->childNodes : $dom); }
/** * {@inheritdoc} */ public function dump(Template $template) { $metadata = $template->getMetadata(); $dom = $template->getDocument(); $dom->preserveWhiteSpace = true; $dom->formatOutput = false; if ($metadata['xmldeclaration']) { return $dom->saveXML(); } else { $xml = ''; foreach ($dom->childNodes as $node) { $xml .= $dom->saveXML($node); if ($node instanceof \DOMDocumentType) { $xml .= PHP_EOL; } } return $xml; } }