Skip to content

Commit

Permalink
LatteExtension: fix undefined property
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar authored and dg committed Jan 26, 2021
1 parent 556322f commit 13f5ab3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Bridges/ApplicationDI/LatteExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ public function beforeCompile()
public static function initLattePanel(ApplicationLatte\TemplateFactory $factory, Tracy\Bar $bar, bool $all = false)
{
$factory->onCreate[] = function (ApplicationLatte\Template $template) use ($bar, $all) {
if ($all || $template->control instanceof Nette\Application\UI\Presenter) {
$control = $template->control ?? null;
if ($all || $control instanceof Nette\Application\UI\Presenter) {
$bar->addPanel(new Latte\Bridges\Tracy\LattePanel(
$template->getLatte(),
$all ? (new \ReflectionObject($template->control))->getShortName() : ''
$all && $control ? (new \ReflectionObject($control))->getShortName() : ''
));
}
};
Expand Down

0 comments on commit 13f5ab3

Please sign in to comment.