Skip to content

Instantly share code, notes, and snippets.

@Eflyax
Created July 10, 2019 08:36
Show Gist options
  • Save Eflyax/36a1a908ccbd3a457e8326e7d4c47f61 to your computer and use it in GitHub Desktop.
Save Eflyax/36a1a908ccbd3a457e8326e7d4c47f61 to your computer and use it in GitHub Desktop.
<?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