PHPackages                             emodric/twig-package-versions - 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. emodric/twig-package-versions

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

emodric/twig-package-versions
=============================

Twig functions that return a package version by using jean85/pretty-package-versions library

2.0.0(6mo ago)6112.5k↓64.3%2MITPHPPHP ^8.4CI passing

Since May 22Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/emodric/twig-package-versions)[ Packagist](https://packagist.org/packages/emodric/twig-package-versions)[ Docs](http://github.com/emodric/twig-package-versions)[ RSS](/packages/emodric-twig-package-versions/feed)WikiDiscussions master Synced yesterday

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

Package Versions Twig extension
===============================

[](#package-versions-twig-extension)

This package provides simple Twig functions that wrap [PrettyPackageVersions](https://github.com/Jean85/pretty-package-versions)lib by [Alessandro Lai](https://github.com/Jean85) making it possible to output version strings of your libraries directly inside your Twig templates.

Initially, this Twig extension was submitted as a [pull request](https://github.com/twigphp/Twig-extensions/pull/226) against official [Twig Extensions](https://github.com/twigphp/Twig-extensions) collection, but was turned into a separate package since no new features are accepted over there.

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

[](#installation)

To install this extension, use Composer:

```
composer require emodric/twig-package-versions

```

Using the extension
-------------------

[](#using-the-extension)

In PHP:

```
$twig = new \Twig\Environment($loader, $options);

$twig->addExtension(new \EdiModric\Twig\VersionExtension());
```

In a Symfony project, you can register the extension as a service:

```
services:
    twig.extension.version:
        class: EdiModric\Twig\VersionExtension
        tags:
            - { name: twig.extension }
```

Once set up, you can use the following Twig functions:

- `package_version('my-vendor/package-name')` - Returns the full package version string
- `pretty_package_version('my-vendor/package-name')` - Returns pretty package version string

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance68

Regular maintenance activity

Popularity35

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 96.7% 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 ~926 days

Total

4

Last Release

185d ago

Major Versions

1.1.0 → 2.0.02025-12-30

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/362286?v=4)[Edi Modrić](/maintainers/emodric)[@emodric](https://github.com/emodric)

---

Top Contributors

[![emodric](https://avatars.githubusercontent.com/u/362286?v=4)](https://github.com/emodric "emodric (29 commits)")[![MarioBlazek](https://avatars.githubusercontent.com/u/6605175?v=4)](https://github.com/MarioBlazek "MarioBlazek (1 commits)")

---

Tags

packagesymfonytemplatingtwigversionsymfonytwigpackagetemplatingversion

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/emodric-twig-package-versions/health.svg)

```
[![Health](https://phpackages.com/badges/emodric-twig-package-versions/health.svg)](https://phpackages.com/packages/emodric-twig-package-versions)
```

###  Alternatives

[timber/timber

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

5.7k3.7M132](/packages/timber-timber)[symfony/ux-twig-component

Twig components for Symfony

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

Live components for Symfony

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

CKEditor 5 integration for Symfony

262.6k](/packages/mati365-ckeditor5-symfony)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

16126.1k1](/packages/symfony-ux-toolkit)[goetas/twital-bundle

Twital templating engine Symfony Bundle

206.8k](/packages/goetas-twital-bundle)

PHPackages © 2026

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