-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #35
- Loading branch information
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php namespace Konafets\Typo3Debugbar\ViewHelpers; | ||
|
||
use Konafets\Typo3Debugbar\Overrides\DebuggerUtility; | ||
use Konafets\Typo3Debugbar\Typo3DebugBar; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper; | ||
|
||
class DebugbarViewHelper extends AbstractViewHelper | ||
{ | ||
/** | ||
* Displays the debug information in the PHP Debug Bar | ||
* | ||
* @param null|string $content | ||
*/ | ||
public function render($content = null) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
{ | ||
if(is_null($content)) { | ||
$content = $this->renderChildren(); | ||
} | ||
|
||
/** @var Typo3DebugBar $debugBar */ | ||
$debugBar = GeneralUtility::makeInstance(Typo3DebugBar::class); | ||
if ($debugBar->isEnabled()) { | ||
DebuggerUtility::var_dump($content); | ||
} | ||
|
||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Friendly reminder: render method arguments are long deprecated in Fluid.