Skip to content

Commit a6e64a8

Browse files
committed
Latte: uses TracyExtension if exists
1 parent a555e68 commit a6e64a8

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"nette/di": "<3.0.7",
4242
"nette/forms": "<3.0",
4343
"nette/schema": "<1.2",
44-
"latte/latte": "<2.7.1 || >=3.1 || =3.0.0",
44+
"latte/latte": "<2.7.1 || >=3.0.0 <3.0.5 || >=3.1",
4545
"tracy/tracy": "<2.5"
4646
},
4747
"autoload": {

src/Bridges/ApplicationDI/LatteExtension.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,8 @@ public static function initLattePanel(
116116
$factory->onCreate[] = function (ApplicationLatte\Template $template) use ($bar, $all) {
117117
$control = $template->getLatte()->getProviders()['uiControl'] ?? null;
118118
if ($all || $control instanceof Nette\Application\UI\Presenter) {
119-
$bar->addPanel(new Latte\Bridges\Tracy\LattePanel(
120-
$template->getLatte(),
121-
$all && $control ? (new \ReflectionObject($control))->getShortName() : ''
122-
));
119+
$name = $all && $control ? (new \ReflectionObject($control))->getShortName() : '';
120+
$template->getLatte()->addExtension(new Latte\Bridges\Tracy\TracyExtension($name));
123121
}
124122
};
125123
}

0 commit comments

Comments
 (0)