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

ActiveLibrary

jmf/twig-sort
=============

Twig extension for sorting arrays in Twig templates.

1.0.0(1y ago)0299↑250%3mitPHPPHP &gt;=8.3

Since Jun 5Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (8)Versions (2)Used By (3)

Twig extension : sort
=====================

[](#twig-extension--sort)

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

[](#installation--requirements)

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

```
composer require jmf/twig-sort
```

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

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

### sort() filter

[](#sort-filter)

Sorts provided array by value, losing key-value association.

```
{% set sorted = values|sort %}
```

### rsort() filter

[](#rsort-filter)

Reverse-sorts provided array by value, losing key-value association.

```
{% set sorted = values|rsort %}
```

### asort() filter

[](#asort-filter)

Sorts provided array by value, preserving key-value association.

```
{% set sorted = values|asort %}
```

### arsort() filter

[](#arsort-filter)

Reverse-sorts provided array by value, preserving key-value association.

```
{% set sorted = values|arsort %}
```

### ksort() filter

[](#ksort-filter)

Sorts provided array by key.

```
{% set sorted = values|ksort %}
```

### krsort() filter

[](#krsort-filter)

Reverse-sorts provided array by key.

```
{% set sorted = values|krsort %}
```

### psort() filter

[](#psort-filter)

Sorts provided array of arrays or array of objects by properties.

```
{% set sorted = articles|psort('title') %}
{% set sorted = articles|psort(['title', 'author.name']) %}
{% set sorted = articles|psort({'publication_date': 'desc', 'author': 'asc'}) %}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity55

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

713d ago

### 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 (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[abydahana/aksara

Aksara is a CodeIgniter based CRUD Toolkit you can use to build complex applications become shorter, secure and more reliable just in a few lines of code. Serving both CMS or Framework, produce both HEADLESS (RESTful API) or TRADITIONAL (Browser Based), just by writing single controller. Yet it's reusable, scalable and ready to use!

1101.2k](/packages/abydahana-aksara)

PHPackages © 2026

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