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 May 30Pushed 3w 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 3w ago

READMEChangelogDependenciesVersions (2)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 elcreator/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.

### Compatibility with regular EVO template code

[](#compatibility-with-regular-evo-template-code)

aLatteX works as a pre-processing layer before Evolution CMS's normal parser. Classic EVO tags written directly in the template are protected while Latte is rendering and restored before Evolution CMS calls `parseDocumentSource()`.

That means existing template code like this continues to be processed by Evolution CMS after Latte finishes:

```
{{chunk}}
[[snippet]]
[!snippet!]
[*pagetitle*]
[*content*]
[(site_name)]
[+placeholder+]
[[snippet?&id=`[*id*]`]]
```

Processing order:

```
DB template
    -> aLatteX protects EVO tags
    -> Latte renders Latte syntax
    -> aLatteX restores EVO tags
    -> Evolution CMS parseDocumentSource() resolves EVO tags

```

Important caveats:

- Latte runs before Evolution CMS parses chunks, snippets, TVs, settings, and placeholders.
- Latte syntax inside chunks or snippet output is not processed later, because those values are generated after Latte has already finished.
- Regular EVO tags written directly in the template are passed through for the default Evolution CMS parser to handle.

### 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`$evo`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-3.0-or-later

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance62

Regular maintenance activity

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60% 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 (6 commits)")[![cursoragent](https://avatars.githubusercontent.com/u/199161495?v=4)](https://github.com/cursoragent "cursoragent (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

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.0k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

291.8k](/packages/webkinder-sproutset)[awkwardideas/switchblade

Extended blade directives for laravel

102.1k](/packages/awkwardideas-switchblade)

PHPackages © 2026

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