Move getElementInnerHTML from button to DomDocumentHelper

[MAILPOET-5741]
This commit is contained in:
Rostislav Wolny
2024-02-22 12:35:57 +01:00
committed by Rostislav Wolný
parent febc070c0f
commit aa658782fb
2 changed files with 12 additions and 16 deletions

View File

@@ -47,4 +47,14 @@ class DomDocumentHelper {
public function getOuterHtml(\DOMElement $element): string {
return (string)$this->dom->saveHTML($element);
}
public function getElementInnerHTML(\DOMElement $element): string {
$innerHTML = '';
$children = $element->childNodes;
foreach ($children as $child) {
if (!$child instanceof \DOMNode) continue;
$innerHTML .= $this->dom->saveHTML($child);
}
return $innerHTML;
}
}