LATTE Template Engine

All examples use regular HTML or PHP syntax. I prefer to use LATTE for all my documents as it helps me to keep my templates clean and it provides many great helpers that would otherwise need additional checks.

As RockPdf relies on RockFrontend we have LATTE support out of the box 😎🚀

You don't know latte yet? Be sure to check out their website at https://latte.nette.org/de/ and also check this forum post: Why I love the Latte Template Engine.

All you have to do is load a LATTE file instead of an HTML or PHP file:

/** @var RockPdf $pdf */
$pdf = $modules->get('RockPdf');
$pdf
  ->load("/site/test.latte")
  ->save(preview: true);

Latte and mPDF tags

mPDF tags like {PAGENO} conflict with the default latte single brace syntax. Simply change the syntax to off or double:

<p n:syntax="off">Page {PAGENO}/{nb}</p>