Skip to content

Commit

Permalink
Latte: uses TracyExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 27, 2022
1 parent a555e68 commit 7b53e9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"nette/di": "<3.0.7",
"nette/forms": "<3.0",
"nette/schema": "<1.2",
"latte/latte": "<2.7.1 || >=3.1 || =3.0.0",
"latte/latte": "<2.7.1 || >=3.0.0 <3.0.5 || >=3.1",
"tracy/tracy": "<2.5"
},
"autoload": {
Expand Down
6 changes: 2 additions & 4 deletions src/Bridges/ApplicationDI/LatteExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ public static function initLattePanel(
$factory->onCreate[] = function (ApplicationLatte\Template $template) use ($bar, $all) {
$control = $template->getLatte()->getProviders()['uiControl'] ?? null;
if ($all || $control instanceof Nette\Application\UI\Presenter) {
$bar->addPanel(new Latte\Bridges\Tracy\LattePanel(
$template->getLatte(),
$all && $control ? (new \ReflectionObject($control))->getShortName() : ''
));
$name = $all && $control ? (new \ReflectionObject($control))->getShortName() : '';
$template->getLatte()->addExtension(new Latte\Bridges\Tracy\TracyExtension($name));
}
};
}
Expand Down

0 comments on commit 7b53e9d

Please sign in to comment.