/** * Debug helper to print the tag tree in HTML format. * * @param XenForo_Html_Tag $tag Current/root tag * @param string $prefix Prefix for each line */ public function printTags(XenForo_Html_Tag $tag, $prefix = '') { echo $prefix . 'Tag: ' . $tag->tagName() . ' ' . json_encode($tag->attributes()) . "<br />\n"; $childPrefix = "{$prefix} "; foreach ($tag->children() as $child) { if ($child instanceof XenForo_Html_Tag) { $this->printTags($child, $childPrefix); } else { echo $childPrefix . "'" . htmlspecialchars($child) . "'<br />\n"; } } }