PHPackages                             devture/silex-asset-bundle - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. devture/silex-asset-bundle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

devture/silex-asset-bundle
==========================

Silex bundle that provides some simple project assets linking

2.0(9y ago)0370BSDPHP

Since Jan 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/devture/silex-asset-bundle)[ Packagist](https://packagist.org/packages/devture/silex-asset-bundle)[ RSS](/packages/devture-silex-asset-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Asset Bundle
============

[](#asset-bundle)

Provides asset linking.

Configuration example
---------------------

[](#configuration-example)

Example for the article bundle data source:

```
"AssetBundle": {
	"allow_cdn": true,
	"asset_path": "/srv/http/example.com/web",
	"asset_url_prefix": ""
}

```

Initializing
------------

[](#initializing)

```
$namespace = 'asset';
$app->register(new \Devture\Bundle\AssetBundle\ServicesProvider($asset, $this['config']['AssetBundle']));

```

All provided Twig functions will be prefixed with `asset_` (the namespace used when registering).

Usage
-----

[](#usage)

### Basic Asset Loading

[](#basic-asset-loading)

Using the `asset_url(LOCAL_FILE)` function would generate a URL to the file. The file will be timestamped with its last-modification-time, for caching (cache-busting) purposes.

```

```

Result:

```

```

### CDN-backed Asset Loading

[](#cdn-backed-asset-loading)

Just like `asset_url(LOCAL_FILE)`, you can use `asset_url_with_cdn(LOCAL_FILE, CDN_MIRROR_URI)`to specify a resource which is available both at the `LOCAL_FILE` path and at the `CDN_MIRROR_URI` URI.

Based on the `allow_cdn` configuration parameter (passed when registering the bundle), the appropriate URI will be used.

Example:

```

```

Result (if CDN usage is allowed in the configuration):

```

```

Result (if CDN usage is NOT allowed in the configuration):

```

```

If you rely on CDN-loading, you may also with to make use of [Subresource Integrity](http://www.w3.org/TR/SRI/), to ensure that the resource you're loading is the one you expect.

Example:

```

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

2

Last Release

3391d ago

Major Versions

1.0 → 2.02017-03-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/9daf523f8e47ddeb8af23183c06721c4e89111eb4eb3f9ce264242b373e9dd80?d=identicon)[spantaleev](/maintainers/spantaleev)

---

Top Contributors

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

---

Tags

bundleassetssilex

### Embed Badge

![Health badge](/badges/devture-silex-asset-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/devture-silex-asset-bundle/health.svg)](https://phpackages.com/packages/devture-silex-asset-bundle)
```

###  Alternatives

[igorw/config-service-provider

A config ServiceProvider for Silex with support for php, json and yaml.

215638.9k13](/packages/igorw-config-service-provider)[jbinfo/mobile-detect-service-provider

A mobile detect ServiceProvider for Silex, based on Mobile-Detect library.

25332.9k](/packages/jbinfo-mobile-detect-service-provider)[franmomu/silex-pagerfanta-provider

Silex ServiceProvider for Pagerfanta Library

1312.1k](/packages/franmomu-silex-pagerfanta-provider)

PHPackages © 2026

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