PHPackages                             rvanginneken/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. [Templating &amp; Views](/categories/templating)
4. /
5. rvanginneken/asset-bundle

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

rvanginneken/asset-bundle
=========================

Include assets at any point, which are cached and injected at the end of head or body.

3.2.0(6y ago)51.4k1[2 issues](https://github.com/rvanginneken/AssetBundle/issues)MITPHPPHP &gt;=7.1

Since Nov 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/rvanginneken/AssetBundle)[ Packagist](https://packagist.org/packages/rvanginneken/asset-bundle)[ RSS](/packages/rvanginneken-asset-bundle/feed)WikiDiscussions 3.x Synced yesterday

READMEChangelog (10)Dependencies (6)Versions (25)Used By (0)

AssetBundle
===========

[](#assetbundle)

The AssetBundle makes it easy to include assets at any point in your twig files and render it at the end of the &lt;head&gt; and &lt;body&gt; tags in the page. No blocks needed. Stylesheets are printed inline and all results are cached in production, following Symfony's *cache.app* settings.

In debug mode, actual assets are served. In no-debug mode, files are copied to *public/asset\_cache* with unique naming. The directory is automatically cleared with the *cache:clear* command. Using unique file names guarantees browser cache busting when the application cache is cleared.

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

[](#installation)

Require the bundle with composer:

```
    $ composer require rvanginneken/asset-bundle
```

Enable the bundle in the `config/bundles.php` (*use `AppKernel.php` before symfony 4*):

```
    return [
        // ..
        RVanGinneken\AssetBundle\RVanGinnekenAssetBundle::class => ['all' => true],
        // ..
    ];
```

Ignore the asset cache directory (used to bust browser cache). Put the following in your `.gitignore` (*use `web` before symfony 4*):

```
    # ..
    /public/asset_cache/
    # ..

```

That's it.

Usage
-----

[](#usage)

Note: priorities are optional and are only added to these examples to show their availability.

Include a stylesheet:

```
    {% asset 'css_file', 'css/hello_world.css', 0 %}
```

Include inline style:

```
    {%- set inline_style_hello_world -%}

            body {
                background-color: lightblue;
            }

    {%- endset -%}

    {% asset 'css', inline_style_hello_world, 0 %}
```

Include a javascript file:

```
    {% asset 'javascript_file', 'js/hello_world.js', 0 %}
```

Include inline javascript:

```
    {%- set inline_javascript_hello_world -%}

            console.log('Hello world!');

    {%- endset -%}

    {% asset 'javascript', inline_javascript_hello_world, 0 %}
```

Public folder
-------------

[](#public-folder)

The bundle detects the public folder based on the symfony version. If you're using something custom you can override it by using:

```
    rvanginneken_asset:
        public_folder: your_custom_folder

```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

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

Recently: every ~98 days

Total

24

Last Release

2413d ago

Major Versions

1.5.0 → 2.0.02018-01-06

2.0.2 → 3.0.02018-01-10

2.0.3 → 3.0.12018-01-10

2.1.3 → 3.1.02018-10-07

PHP version history (2 changes)1.0.0PHP ^7.1

2.x-devPHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2691312?v=4)[Roy Van Ginneken](/maintainers/rvanginneken)[@rvanginneken](https://github.com/rvanginneken)

---

Top Contributors

[![rvanginneken](https://avatars.githubusercontent.com/u/2691312?v=4)](https://github.com/rvanginneken "rvanginneken (37 commits)")

---

Tags

symfonybundletwigcacheassetinclude

### Embed Badge

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

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)

PHPackages © 2026

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