_subject = $subject; $this->_showBlockHints = $showBlockHints; } /** * Insert debugging hints into the rendered block contents * * {@inheritdoc} */ public function render(\Magento\Framework\View\Element\BlockInterface $block, $templateFile, array $dictionary = []) { $result = $this->_subject->render($block, $templateFile, $dictionary); if ($this->_showBlockHints) { $result = $this->_renderBlockHints($result, $block); } $result = $this->_renderTemplateHints($result, $templateFile); return $result; } /** * Insert template debugging hints into the rendered block contents * * @param string $blockHtml * @param string $templateFile * @return string */ protected function _renderTemplateHints($blockHtml, $templateFile) { return <<
{$templateFile}
{$blockHtml} HTML; } /** * Insert block debugging hints into the rendered block contents * * @param string $blockHtml * @param \Magento\Framework\View\Element\BlockInterface $block * @return string */ protected function _renderBlockHints($blockHtml, \Magento\Framework\View\Element\BlockInterface $block) { $blockClass = get_class($block); return <<{$blockClass} {$blockHtml} HTML; } }