PHPackages                             fffunction/twig-static - 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. fffunction/twig-static

ActiveLibrary

fffunction/twig-static
======================

A filter that takes a static file path and returns a URL versioned with the file hash

1.0.0(8y ago)142MITPHP

Since Jul 7Pushed 8y ago4 watchersCompare

[ Source](https://github.com/fffunction/twig-static)[ Packagist](https://packagist.org/packages/fffunction/twig-static)[ RSS](/packages/fffunction-twig-static/feed)WikiDiscussions master Synced 2d ago

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

twig-static
===========

[](#twig-static)

[![Build Status](https://camo.githubusercontent.com/6b092169b1bda0cea5a11d796350ab7a04a2d95bdc9ce9f58c93798b42193461/68747470733a2f2f7472617669732d63692e6f72672f666666756e6374696f6e2f747769672d7374617469632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fffunction/twig-static)

```
composer require fffunction/twig-static

```

Usage
-----

[](#usage)

Add the filter to Twig:

```
$twig->addFilter('static', new Twig_Filter_Function(
    create_static_filter('path/to/assets/', '/url/to/prepend/')
));
```

Then pass paths to the filter in your templates:

```
{{ 'js/app.bundle.js' | static }}
{# /url/to/prepend/js/app.bundle.js?v=1a2b3c4 #}
```

API
---

[](#api)

`create_static_filter(sting $asset_root, string $asset_url): function`

- `$asset_root`: a relative path from the app root to the assets root dir
- `$asset_url`: a path to prepend to the returned url

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% 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

3232d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/898a30d79f77ced6ecc44bb80726eda34dcdcc36bf1edab68ae4885a9016b66c?d=identicon)[danreeves](/maintainers/danreeves)

---

Top Contributors

[![danreeves](https://avatars.githubusercontent.com/u/1973559?v=4)](https://github.com/danreeves "danreeves (10 commits)")[![urlsangel](https://avatars.githubusercontent.com/u/560463?v=4)](https://github.com/urlsangel "urlsangel (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fffunction-twig-static/health.svg)

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

PHPackages © 2026

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