Get and HTML DOMElement of the fragment and append it
1 unresolved thread
Closes #3412644
Merge request reports
Activity
113 121 '#item' => NULL, 114 122 ]; 123 115 124 $fragment_node = $dom->createDocumentFragment(); 116 125 $html = Html::normalize($this->renderer->render($build)); 117 $fragment_node->appendXML($html); 126 // Trim to ensure the first child is a DOMElement. 127 $html = trim($html); 128 // Build a new DOMDocument for the HTML. 129 $fragment_dom = Html::load($html); 130 // Get the body element of the new document. 131 $fragment_body = $fragment_dom->getElementsByTagName('body')->item(0); 132 // Import the new (header) node onto the original DOMDocument. 133 $fragment_import_node = $dom->importNode($fragment_body->firstChild, true); 134 $fragment_node->appendChild($fragment_import_node); 135 - Comment on lines -117 to +135
changed this line in version 2 of the diff
mentioned in merge request !12 (merged)
Please register or sign in to reply