Latte Panel and Tracy standalone

materix
Backer | 83
+
0
-

I am using Latte 2.11 and Tracy 2.9.


Tracy\Debugger::enable(Tracy\Debugger::DEVELOPMENT);

$latte = new Latte\Engine();

How do I enable the LattePanel in Tracy, when using them standalone?

Marek Bartoš
Nette Blogger | 1261
+
+1
-

Latte\Bridges\Tracy\LattePanel::initialize($latte);

materix
Backer | 83
+
0
-

Thanks!

But no new panel appears in Tracy when I do:


Tracy\Debugger::enable(Tracy\Debugger::DEVELOPMENT);
$latte = new Latte\Engine();
Latte\Bridges\Tracy\LattePanel::initialize($latte);
Marek Bartoš
Nette Blogger | 1261
+
0
-

It will appear in Tracy only if the Engine instance is used to render a file.

materix
Backer | 83
+
0
-

I missed the last line of code in my previous post. Here is my actual code:


Tracy\Debugger::enable(Tracy\Debugger::DEVELOPMENT);
$latte = new Latte\Engine();
Latte\Bridges\Tracy\LattePanel::initialize($latte);
$latte->render('latte/index.latte', $page);

but no Latte-panel appears…

Marek Bartoš
Nette Blogger | 1261
+
+1
-

Other panels work for you? You may be adding it too late. Otherwise I don't see reason why it shouldn't work.

Last edited by Marek Bartoš (2022-10-03 16:02)

materix
Backer | 83
+
0
-

Thanks, you are correct! I had to add the code earlier.

bernhard
Member | 51
+
0
-

Hey everyone,

we have had this implementation in RockFrontend for the ProcessWire CMS, but now I get this compile error:
https://i.imgur.com/EiWTFAq.png

Also the API docs say ::initialize is deprecated, but I don't know how to fix that. https://api.nette.org/…tePanel.html

See here for background: https://processwire.com/…acydebugger/?…

This is how I had it implemented but I simply removed it for the time being as I did not find a way to add it back without the error: https://github.com/…67eee4b89e9e

Any pointers would be much appreciated, thx!

Last edited by bernhard (2023-06-07 16:16)

Marek Bartoš
Nette Blogger | 1261
+
0
-

Deprecation message says to use TracyExtension. It should be as simple as that:

$latte = new \Latte\Engine();
$latte->addExtension(new \Latte\Bridges\Tracy\TracyExtension());
bernhard
Member | 51
+
0
-

Awesome, thx! https://github.com/…2caec62d60f3

Yeah, I read that. It said WHAT, but not HOW :)