Created
July 10, 2019 08:36
-
-
Save Eflyax/36a1a908ccbd3a457e8326e7d4c47f61 to your computer and use it in GitHub Desktop.
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
<?php declare(strict_types=1); | |
namespace App\Panels; | |
use Nette; | |
class MyPanelExtension extends Nette\DI\CompilerExtension | |
{ | |
public function afterCompile(Nette\PhpGenerator\ClassType $generatedContainer) | |
{ | |
$builder = $this->getContainerBuilder(); | |
$initialize = $generatedContainer->getMethod('initialize'); | |
$initialize->addBody($builder->formatPhp('?;', [ | |
new Nette\DI\Statement('Tracy\Debugger::getBlueScreen()->addPanel(?)', ['\App\Panels\MyPanelExtension::bluescreen']), | |
])); | |
} | |
public static function bluescreen($exception) | |
{ | |
return [ | |
'bottom' => TRUE, | |
'tab' => 'Nadpis tabu', | |
'panel' => <<<HEREDOC | |
<p>obsah tabu</p> | |
HEREDOC | |
, | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment