PhpTemplateEngine
in package
implements
TemplateEngine
FinalYes
Plain PHP templates for use without Laravel.
A template is a PHP file that receives $invoice (view model) and $e (escape function). The name "default" refers to the template shipped with the core.
Template names are never file paths: "custom" or "invoices/modern" resolve to "{path}/{name}.php" inside one of the configured directories (or the shipped templates), so a name from a request or from invoice data cannot include an arbitrary file.
Table of Contents
Interfaces
- TemplateEngine
- Turns the view model into HTML for the PDF renderer (Blade, plain PHP, Twig …).
Methods
- __construct() : mixed
- render() : string
Methods
__construct()
public
__construct([array<int, string> $paths = [] ]) : mixed
Parameters
- $paths : array<int, string> = []
-
directories searched for "{name}.php"
render()
public
render(string $template, InvoiceViewModel $invoice[, array<string|int, mixed> $data = [] ]) : string
Parameters
- $template : string
- $invoice : InvoiceViewModel
- $data : array<string|int, mixed> = []
-
additional variables