PHPackages                             prgfx/fusion-template-literals - 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. prgfx/fusion-template-literals

ActiveNeos-package[Templating &amp; Views](/categories/templating)

prgfx/fusion-template-literals
==============================

A fusion DSL providing a syntax similar to the javascript tagged template literals

0.3.0(6y ago)08GPL-3.0-or-laterPHP

Since Jan 5Pushed 6y ago1 watchersCompare

[ Source](https://github.com/PRGfx/Fusion-Template-Literals)[ Packagist](https://packagist.org/packages/prgfx/fusion-template-literals)[ RSS](/packages/prgfx-fusion-template-literals/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Prgfx.Fusion.TemplateLiterals
=============================

[](#prgfxfusiontemplateliterals)

A [Neos Fusion](https://github.com/neos/typoscript) DSL implementation based on tagged template literals in javascript.

```
composer require prgfx/fusion-template-literals

```

Usage
-----

[](#usage)

By default this package defines the DSL identifier `plain`, but you can alias it for more meaningful tags for your application.

```
p = Some.Example:Prototype {
    value = plain`Some text with ${I18n.translate('interpolated')} values`
}
```

This package comes with two implementations: an array-renderer (creating a fusion array-like object (e.g. `Neos.Fusion:Array` or `Neos.Fusion:Join` as per configuration)) and an eel-expression renderer.
The latter has the advantage that you may reference variables as `${this.variable}` as it would seem intuitive:

```
trackingId = ${Configuration.setting(...)}
snippet = inline`(w=> { w.qa=w.qa||[];w.qa.push('create', '${this.trackingId}');})(window);`
```

**However** this does not work well with multiline blocks as the eel expression does not properly output newlines. This would be fine for snippets like shown above with block mode `compress` (see below). (After all this package mainly targets such scenarios.)

Multiline blocks
----------------

[](#multiline-blocks)

Given a block-mode modifier in the first line (and nothing else in this line), multiline blocks may be interpreted differently. The block-mode modifier can be configured in `Prgfx.Fusion.TemplateLiterals.blockDelimiters` to your preferences. There are different multiline block-modes:

### default

[](#default)

only cut off surrounding empty lines, keeps the rest as is

```
value = plain`
    line 1
    line 2
`
// will not contain the first and last "empty" line
```

### block

[](#block)

will trim all indentation

```
value = plain`|
    line 1
        line 2
    line 3
`
// will return 'line 1\n    line 2\nline3'
```

### singleLine

[](#singleline)

will trim all indentation and join newlines with a single space.
double newlines will create a line break.

```
value = plain`>
    line 1
    line 2

    line 3
`
// 'line 1 line 2\nline3'
```

### compress

[](#compress)

compared to singleLine will remove *all* surrounding whitespace per line:

```
value = plain`>>
if (foo) {
    console.log(foo);
}
`
// 'if (foo) { console.log(foo); }'
```

Custom implementations
----------------------

[](#custom-implementations)

This package is implemented in a way that you can easily extend the `PlainTemplateLiterals` implementation and override the `generateCode` method. This method receives `stringParts: string[]` and `...expressions: string[]` just like the javascript equivalent.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2369d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/95804274?v=4)[Markus Klatte](/maintainers/mklatte)[@mklatte](https://github.com/mklatte)

---

Top Contributors

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

---

Tags

neos-fusionneoscms

### Embed Badge

![Health badge](/badges/prgfx-fusion-template-literals/health.svg)

```
[![Health](https://phpackages.com/badges/prgfx-fusion-template-literals/health.svg)](https://phpackages.com/packages/prgfx-fusion-template-literals)
```

###  Alternatives

[neos/fusion-afx

JSX inspired compact syntax for Neos.Fusion

26984.8k62](/packages/neos-fusion-afx)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[neos/neos

An open source Content Application Platform based on Flow. A set of core Content Management features is resting within a larger context that allows you to build a perfectly customized experience for your users.

1151.0M753](/packages/neos-neos)[sandstorm/neostwofactorauthentication

1327.0k](/packages/sandstorm-neostwofactorauthentication)[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)

PHPackages © 2026

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