PHPackages                             jmf/twig-array - 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. jmf/twig-array

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

jmf/twig-array
==============

Twig extension for interacting with arrays in Twig templates.

1.0.1(1mo ago)03943mitPHPPHP ^8.3CI passing

Since Jun 5Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/jmfeurprier/twig-array)[ Packagist](https://packagist.org/packages/jmf/twig-array)[ RSS](/packages/jmf-twig-array/feed)WikiDiscussions 1.0 Synced today

READMEChangelogDependencies (14)Versions (3)Used By (3)

Twig extension : array
======================

[](#twig-extension--array)

Installation &amp; Requirements
-------------------------------

[](#installation--requirements)

Install with [Composer](https://getcomposer.org):

```
composer require jmf/twig-array
```

Usage in Twig templates
-----------------------

[](#usage-in-twig-templates)

### array\_set()

[](#array_set)

Sets a specific key in an array.

```
{% set values = {} %}

{% set values = values|array_set('foo', 'bar') %}
```

### array\_unset()

[](#array_unset)

Unsets a specific key in an array.

```
{% set values = {'foo': 'bar'} %}

{% set values = values|array_unset('foo') %}
```

### array\_push()

[](#array_push)

Appends a new value at the end of an array.

```
{% set values = {'foo'} %}

{% set values = values|array_push('bar') %}
```

### array\_pop()

[](#array_pop)

Removes the last item of an array.

```
{% set values = {'foo', 'bar'} %}

{% set values = values|array_pop() %}
```

### array\_unshift()

[](#array_unshift)

Appends a new value at the beginning of an array.

```
{% set values = {'foo'} %}

{% set values = values|array_unshift('bar') %}
```

### array\_shift()

[](#array_shift)

Removes the first item of an array.

```
{% set values = {'foo', 'bar'} %}

{% set values = values|array_shift() %}
```

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance93

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

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 ~362 days

Total

3

Last Release

34d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.3

1.0.1PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b08b8105ec8bc88d1c911e10dbf156814769650a67960e2f3d71ed6d2417f0d?d=identicon)[jmfeurprier](/maintainers/jmfeurprier)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jmf-twig-array/health.svg)

```
[![Health](https://phpackages.com/badges/jmf-twig-array/health.svg)](https://phpackages.com/packages/jmf-twig-array)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[symfony/ux-twig-component

Twig components for Symfony

22018.6M355](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1647.0M128](/packages/symfony-ux-live-component)

PHPackages © 2026

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