Skip to content

Commit

Permalink
LatteExtension: inject interface to be more compatible (#288)
Browse files Browse the repository at this point in the history
Co-authored-by: Miloslav Hůla <miloslav.hula@fsv.cvut.cz>
  • Loading branch information
2 people authored and dg committed Jun 2, 2021
1 parent c18b35a commit 8a61eb2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Bridges/ApplicationDI/LatteExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,14 @@ public function beforeCompile()
}


public static function initLattePanel(ApplicationLatte\TemplateFactory $factory, Tracy\Bar $bar, bool $all = false)
{
public static function initLattePanel(
Nette\Application\UI\TemplateFactory $factory,
Tracy\Bar $bar,
bool $all = false
) {
if (!$factory instanceof ApplicationLatte\TemplateFactory) {
return;
}
$factory->onCreate[] = function (ApplicationLatte\Template $template) use ($bar, $all) {
$control = $template->getLatte()->getProviders()['uiControl'] ?? null;
if ($all || $control instanceof Nette\Application\UI\Presenter) {
Expand Down

0 comments on commit 8a61eb2

Please sign in to comment.