PHPackages                             daun/template-engine-latte - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. daun/template-engine-latte

ActiveProcesswire-module[Templating &amp; Views](/categories/templating)

daun/template-engine-latte
==========================

ProcessWire module adding Latte to the TemplateEngineFactory

v2.2.0(9mo ago)71.4k2MITPHPPHP &gt;=8.0

Since Oct 31Pushed 9mo ago3 watchersCompare

[ Source](https://github.com/daun/TemplateEngineLatte)[ Packagist](https://packagist.org/packages/daun/template-engine-latte)[ Docs](https://github.com/daun/TemplateEngineLatte)[ RSS](/packages/daun-template-engine-latte/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (16)Used By (0)

TemplateEngineLatte
===================

[](#templateenginelatte)

[![Build Status](https://camo.githubusercontent.com/328f0e3b4417e2728ff6c301f55d7c3461090424f0868e66fb378354d7e0da2f/68747470733a2f2f7472617669732d63692e6f72672f6461756e2f54656d706c617465456e67696e654c617474652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/daun/TemplateEngineLatte)[![StyleCI](https://camo.githubusercontent.com/30b351051aa43765603455be7ef81c35226f4025f4e09a3c81971c0216462670/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3330383938383734372f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/308988747)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)[![ProcessWire 3](https://camo.githubusercontent.com/34449e2237c61f5c40a0cbf06273d9f22ee4b9ba45442c77b6554c874927b1ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50726f63657373576972652d332e782d6f72616e67652e737667)](https://github.com/processwire/processwire)

A ProcessWire module adding [Latte](https://latte.nette.org/) to the [TemplateEngineFactory](https://github.com/wanze/TemplateEngineFactory).

This module version uses Latte 3, which comes with breaking changes in how tags/macros are defined. If you need to keep using Latte 2, stick with major version `^1.0` of this module. Learn more about the [migration to Latte 3](https://latte.nette.org/en/cookbook/migration-from-latte2) and [upgrading macros to tags](https://tomasvotruba.com/blog/how-to-upgrade-latte-2-macro-to-latte-3-tag/).

Requirements
------------

[](#requirements)

- ProcessWire `3.0` or newer
- TemplateEngineFactory `2.0` or newer
- PHP `8.0` or newer
- Composer

Installation
------------

[](#installation)

Execute the following command in the root directory of your ProcessWire installation:

```
composer require daun/template-engine-latte:^2.0

```

This will install the *TemplateEngineLatte* and *TemplateEngineFactory* modules in one step. Afterwards, don't forget to enable Latte as engine in the *TemplateEngineFactory* module's configuration.

> ℹ️ This module includes test dependencies. If you are installing on production with `composer install`, make sure to pass the `--no-dev` flag to omit autoloading any unnecessary test dependencies!.

Configuration
-------------

[](#configuration)

The module offers the following configuration:

- **`Template files suffix`** The suffix of the Latte template files, defaults to `latte`.
- **`Default layout file`** Layout that all views will extend from unless overwritten.
- **`Provide ProcessWire API variables in Latte templates`** API variables (`$pages`, `$input`, `$config`...) are accessible in Latte, e.g. `{$config}` for the config API variable.
- **`Simplified path resolution`** Enable Blade-style dot syntax for directory traversal. [See below](#simplified-path-resolution).
- **`Auto refresh templates (recompile)`** Recompile templates whenever the source code changes.

### Simplified Path Resolution

[](#simplified-path-resolution)

This option will enable two things:

- Allow dot syntax for directory traversal à la Blade.
- Prepend the base view directory to all paths, eliminating the need for endless `../` in subdirectories.

#### Example

[](#example)

Both of these will resolve to `site/templates/views/partials/navigation.latte`:

- Normal resolution: `{include '../../partials/navigation.latte'}`
- Simplified resolution enabled: `{include 'partials.navigation'}`

Extending Latte
---------------

[](#extending-latte)

It is possible to extend Latte after it has been initialized by the module. Hook the method `TemplateEngineLatte::initLatte` to register custom tags, filters, functions etc.

Here is an example how you can use the provided hook to add custom macros and filters.

```
wire()->addHookAfter('TemplateEngineLatte::initLatte', function (HookEvent $event) {
    /** @var Latte\Engine */
    $latte = $event->arguments('latte');

    // Add filter
    $latte->addFilter('lower', function ($str) { return strtolower($str); });

    // Add custom tags via extensions
    $latte->addExtension(new FooExtension);
});
```

> The above hook can be put in your `site/init.php` file. If you prefer to use modules, put it into the module's `init()`method and make sure that the module is auto loaded.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance56

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~144 days

Recently: every ~155 days

Total

13

Last Release

289d ago

Major Versions

v1.0.6 → v2.0.02023-11-20

v1.1.0 → v2.1.02023-11-22

v1.1.1 → v2.2.02025-08-02

PHP version history (2 changes)v1.0.0PHP &gt;=7.0

v2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/31ac2b3787ded290b6bac87b937abf4f267483e4da64731bfb256a942bb669ca?d=identicon)[daun](/maintainers/daun)

---

Top Contributors

[![daun](https://avatars.githubusercontent.com/u/22225348?v=4)](https://github.com/daun "daun (46 commits)")

---

Tags

latteprocesswireprocesswire-modulestemplate-engineprocesswirelattelatte-engine

### Embed Badge

![Health badge](/badges/daun-template-engine-latte/health.svg)

```
[![Health](https://phpackages.com/badges/daun-template-engine-latte/health.svg)](https://phpackages.com/packages/daun-template-engine-latte)
```

###  Alternatives

[contributte/latte

Extra contrib to nette/latte

111.5M2](/packages/contributte-latte)[nepada/form-renderer

Latte template based form renderer for Nette forms with full support for Bootstrap 3, 4 &amp; 5.

11251.0k](/packages/nepada-form-renderer)[wanze/template-engine-twig

ProcessWire module adding Twig to the TemplateEngineFactory

128.1k](/packages/wanze-template-engine-twig)[wanze/template-engine-factory

Provides ProcessWire integration for various template engines such as Twig.

2612.0k4](/packages/wanze-template-engine-factory)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
