Latte is a secure and intuitive PHP templating engine designed to create safe, maintainable, and efficient web templates.
☕ Latte: the safest & truly intuitive templates for PHP. Engine for those who want the most secure PHP sites.
Latte is primarily used by PHP developers who want to build web applications with a focus on security and clean template syntax. It helps prevent common security issues like XSS by providing a safe templating environment, making it ideal for projects where security and maintainability are critical.
Latte emphasizes security by default, especially automatic output escaping, so developers should avoid disabling these features unless absolutely necessary. It is best used in PHP projects that require robust template security and clear separation of logic and presentation.
Require Latte via Composer: composer require nette/latte
Include the Composer autoloader in your PHP script: require 'vendor/autoload.php';
Create a new instance of Latte\Engine in your PHP code
Load and render templates using the Engine instance
$latte = new Latte\Engine;
Creates a new instance of the Latte templating engine.
$latte->render('template.latte', ['variable' => 'value']);
Renders the specified template file with provided variables.