PHPackages                             jake-fr/twig-set - 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. jake-fr/twig-set

ActiveLibrary[Templating &amp; Views](/categories/templating)

jake-fr/twig-set
================

Set tag for twig with support of combined operators

v0.1.1(9y ago)014MITPHP

Since Jan 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/JakeFr/TwigSet)[ Packagist](https://packagist.org/packages/jake-fr/twig-set)[ RSS](/packages/jake-fr-twig-set/feed)WikiDiscussions master Synced 4w ago

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

JakeFR / TwigSet
================

[](#jakefr--twigset)

**`set`** tag for twig 2 with support of combined operators.

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

[](#requirements)

This librairy requires **Twig 2** and **PHP 7**

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

[](#installation)

Install via Composer

```
$ composer require jake-fr/twig-set
```

Add the extension to twig

The constructor expects one parameter:

An array of supported binary nodes with symbol as key and the binary node class name as value.

```
$operators = [
    '+' => 'Twig_Node_Expression_Binary_Add',
    '-' => 'Twig_Node_Expression_Binary_Sub',
    '~' => 'Twig_Node_Expression_Binary_Concat',
    '*' => 'Twig_Node_Expression_Binary_Mul',
    '/'  => 'Twig_Node_Expression_Binary_Div',
    '//' => 'Twig_Node_Expression_Binary_FloorDiv',
    '%' => 'Twig_Node_Expression_Binary_Mod',
    '**' => 'Twig_Node_Expression_Binary_Power',
];
$twig->addExtension(new \JakeFr\TwigSet\Extension($operators));
```

Usage
-----

[](#usage)

```
{% set foo = 4 %}

{{ foo }} {# will ouput 4 #}

{% set foo += 3 %}

{{ foo }} {# will ouput 7 #}
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~0 days

Total

2

Last Release

3450d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5176129?v=4)[JakeFr](/maintainers/JakeFr)[@JakeFr](https://github.com/JakeFr)

---

Top Contributors

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

---

Tags

twig

### Embed Badge

![Health badge](/badges/jake-fr-twig-set/health.svg)

```
[![Health](https://phpackages.com/badges/jake-fr-twig-set/health.svg)](https://phpackages.com/packages/jake-fr-twig-set)
```

###  Alternatives

[timber/timber

Create WordPress themes with beautiful OOP code and the Twig Template Engine

5.7k3.6M127](/packages/timber-timber)[twig/intl-extra

A Twig extension for Intl

36567.2M322](/packages/twig-intl-extra)[symfony/ux-twig-component

Twig components for Symfony

22017.2M313](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1636.5M116](/packages/symfony-ux-live-component)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22919.7M82](/packages/twig-cssinliner-extra)[twig/inky-extra

A Twig extension for the inky email templating engine

16713.6M71](/packages/twig-inky-extra)

PHPackages © 2026

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