Skip to content

Instantly share code, notes, and snippets.

@KaffDaddy
Last active March 16, 2018 14:48
Show Gist options
  • Save KaffDaddy/cfedfdba113fa09493c6bc32a2de75f2 to your computer and use it in GitHub Desktop.
Save KaffDaddy/cfedfdba113fa09493c6bc32a2de75f2 to your computer and use it in GitHub Desktop.
<?php
namespace VENDOR\EXTENSION\ViewHelpers;
class DebugbarViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{
/**
* Displays the debug informationen in the PHP Debug Bar
*
* @param null $content
*/
public function render($content = NULL)
{
if($content === NULL) {
$content = $this->renderChildren();
}
$currentApplicationContext = \TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext();
if ($currentApplicationContext->isDevelopment()) {
\Konafets\Typo3Debugbar\Overrides\DebuggerUtility::var_dump($content);
}
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment