PHPackages                             elcreator/a-latte-x - 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. elcreator/a-latte-x

ActiveEvolutioncms-plugin[Templating &amp; Views](/categories/templating)

elcreator/a-latte-x
===================

A Latte eXtended template parser for Evolution CMS

00PHP

Since Mar 12Pushed 1w agoCompare

[ Source](https://github.com/elcreator/aLatteX)[ Packagist](https://packagist.org/packages/elcreator/a-latte-x)[ RSS](/packages/elcreator-a-latte-x/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

aLatteX
=======

[](#alattex)

**A Latte eXtended template parser for Evolution CMS.**

Adds [Latte 3.x](https://latte.nette.org) as a third template-parser option alongside the built-in *DocumentParser* and *DLTemplate*. Templates are created and edited directly in the CMS admin panel, saved to the database, compiled to PHP by Latte, and cached — no filesystem template files required.

All existing Evolution CMS template syntax is fully supported alongside Latte syntax in the same template.

---

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

[](#requirements)

- PHP 8.3+
- Evolution CMS 3.5.2+
- `latte/latte` ^3.1 (pulled in automatically via Composer)

---

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

[](#installation)

```
php artisan package:installrequire evolution-cms/a-latte-x "*"
```

Then open **System Settings → Site** and select **aLatteX** in the *Chunk processor* radio group.

---

How it works
------------

[](#how-it-works)

### Rendering pipeline

[](#rendering-pipeline)

```
DB template
    │
    ▼
EvoSyntaxBridge::protect()   — EVO tags replaced with __ALATTEX_N__ tokens
    │
    ▼
Latte::renderToString()      — Latte processes {$vars}, {if}, {foreach}, etc.
    │
    ▼
EvoSyntaxBridge::restore()   — tokens replaced back with original EVO tags
    │
    ▼
EVO parseDocumentSource()    — EVO resolves {{chunks}}, [[snippets]], [*tvs*], etc.

```

The bridge ensures Latte never sees Evolution CMS tags, so neither parser interferes with the other.

### Caching

[](#caching)

Latte compiles each template to a PHP file stored in `storage/framework/cache/latte/`. The cache key is derived from the template content, so the compiled cache automatically invalidates whenever a template is saved in the admin panel.

Evolution CMS page-level caching (`enable_cache`) works as normal on top of this.

---

Writing templates
-----------------

[](#writing-templates)

Templates are written in the admin panel (*Elements → Templates*) using standard Latte syntax. EVO tags can appear anywhere alongside Latte tags.

### Available variables

[](#available-variables)

VariableDescription`$modx`Evolution CMS core object`$documentObject`Full document array (all fields + TVs)`$pagetitle`, `$alias`, `$id`, …All document fields spread as top-level variables`$content`Raw document content (also available as `[*content*]`)### Example template

[](#example-template)

```

    {$pagetitle} — {evoSetting('site_name')}
    {{head_chunk}}

{* Latte conditional *}
{if $longtitle}
    {$longtitle}
{else}
    {$pagetitle}
{/if}

{* Classic EVO chunk — processed after Latte *}
{{nav_chunk}}

{* EVO template variable *}
[*content*]

{* EVO cacheable snippet *}
[[Breadcrumbs?&id=`[*id*]`]]

{* EVO non-cacheable snippet *}
[!RandomBanner!]

{* EVO placeholder set by a snippet *}
[+some_placeholder+]

{{footer_chunk}}

```

### Native Latte helper functions

[](#native-latte-helper-functions)

These are registered by the plugin as first-class Latte functions and can be used anywhere in `{...}` expressions:

FunctionDescription`{evoChunk('name')}`Render an HTML chunk immediately`{evoSnippet('name', ['p' => 'v'])}`Output a cacheable `[[snippet]]` EVO tag for later processing`{evoUncachedSnippet('name', ['p' => 'v'])}`Output a non-cacheable `[!snippet!]` EVO tag for later processing`{evoTv('name')}`Current document TV / field value`{evoSetting('name')}`System setting value`{evoPlaceholder('name')}`Placeholder previously set via `evo()->setPlaceholder()`> **Tip:** `evoSnippet` and `evoUncachedSnippet` return the raw EVO tag string, not the snippet output. This ensures snippet caching behaviour is preserved — the tag is resolved in EVO's own parsing pass after Latte finishes.

### Supported EVO syntax (pass-through)

[](#supported-evo-syntax-pass-through)

The following tags are transparently passed through Latte and resolved by Evolution CMS after Latte rendering:

SyntaxMeaning`{{chunkName}}`HTML chunk`[[snippetName]]`Cacheable PHP snippet`[!snippetName!]`Non-cacheable PHP snippet`[*templateVariable*]`Template variable / document field`[(configSetting)]`System setting`[+placeholder+]`PlaceholderParameters follow standard EVO syntax:

```
[[snippetName?&param1=`value1`&param2=`value2`]]

```

---

Admin panel
-----------

[](#admin-panel)

When the plugin is installed, opening **System Settings** shows an **aLatteX** radio button added to the *Chunk processor* group next to *DocumentParser* and *DLTemplate*.

Selecting **aLatteX** and saving enables Latte template processing site-wide.

---

File structure
--------------

[](#file-structure)

```
aLatteX/
├── composer.json
├── plugins/
│   └── aLattexPlugin.php          Event listeners (OnLoadWebDocument, OnManagerMainFrameHeaderHTMLBlock)
└── src/
    ├── aLattexServiceProvider.php  Laravel service provider
    ├── LattexEngine.php            Latte engine wrapper + render pipeline
    ├── EvoSyntaxBridge.php         EVO tag protect/restore around Latte rendering
    └── EvoExtension.php            Latte extension: evoChunk, evoSnippet, evoTv, …

```

---

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

20

↑

LowBetter than 16% of packages

Maintenance64

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d36fa562f4887de196822681d345f451099c93dddef44546230176f1df051a8?d=identicon)[artur.work](/maintainers/artur.work)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/elcreator-a-latte-x/health.svg)

```
[![Health](https://phpackages.com/badges/elcreator-a-latte-x/health.svg)](https://phpackages.com/packages/elcreator-a-latte-x)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k43.7M272](/packages/mustache-mustache)[knplabs/knp-paginator-bundle

Paginator bundle for Symfony to automate pagination and simplify sorting and other features

1.8k42.2M296](/packages/knplabs-knp-paginator-bundle)[symfony/templating

Provides all the tools needed to build any kind of template system

1.0k68.7M540](/packages/symfony-templating)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8122.9M24](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7052.9M33](/packages/mopa-bootstrap-bundle)[vincentlanglet/twig-cs-fixer

A tool to automatically fix Twig code style

3327.7M56](/packages/vincentlanglet-twig-cs-fixer)

PHPackages © 2026

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