Skip to content

Latest commit

 

History

History
22 lines (19 loc) · 621 Bytes

File metadata and controls

22 lines (19 loc) · 621 Bytes
  $dom = HTML_Parser::parse($html);

        foreach ($dom->children as $node) {
            if ($node instanceof HTML_Parser_Element) {
                $this->_processNode($node, $html, $path, $getTranslation);
            }
        }

        // Remove i18n attributes
        if ($getTranslation) {
            $dom->walk(
                function ($node) {
                    if ($node instanceof HTML_Parser_Element && $node->hasAttribute('i18n')) {
                        $node->hasAttribute('i18n')->remove();
                    }
                }
            );
        }

  return $dom->render();