PHPackages                             endroid/asset - 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. endroid/asset

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

endroid/asset
=============

Endroid Asset

2.7.3(2mo ago)946.4k↓34.6%2MITPHPPHP ^8.4CI passing

Since Apr 8Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/endroid/asset)[ Packagist](https://packagist.org/packages/endroid/asset)[ Docs](https://github.com/endroid/asset)[ GitHub Sponsors](https://github.com/endroid)[ RSS](/packages/endroid-asset/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (40)Used By (2)

Asset
=====

[](#asset)

*By [endroid](https://endroid.nl/)*

[![Latest Stable Version](https://camo.githubusercontent.com/4fce4fcfc91cc4f5b38a253f02ef550277fcbe2bf0f078600d06d0cd6f8939ff/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e64726f69642f61737365742e737667)](https://packagist.org/packages/endroid/asset)[![Build Status](https://github.com/endroid/asset/workflows/CI/badge.svg)](https://github.com/endroid/asset/actions)[![Total Downloads](https://camo.githubusercontent.com/dac359233072b60786228b4ad3a88c501f74b83893da87486ebf4a0ea78ee96a/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e64726f69642f61737365742e737667)](https://packagist.org/packages/endroid/asset)[![License](https://camo.githubusercontent.com/8238c392fc2c83b9d6b58730e5ca5b170691bfb03bb2e47885b994e8feb99928/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e64726f69642f61737365742e737667)](https://packagist.org/packages/endroid/asset)

Library for quick and easy asset management.

Read the [blog](https://medium.com/@endroid/pdf-generation-in-symfony-3080702353b)for more information on why I created this library.

- ControllerAsset: generates the string from a controller action and parameters.
- TemplateAsset: generates the string from a template and parameters.
- FileAsset: generates the string by loading the contents of a file.
- UrlAsset: simply contains a string which is returned when requested.
- DataAsset: simply contains a string which is returned when requested.
- CacheAsset: wraps any of the above in a cache to optimize performance.

All implement AssetInterface and provide the method: getData().

Usage
-----

[](#usage)

The easiest way to work with assets is by letting the factory create assets for you. This allows you to create your assets without worrying about the necessary dependencies.

```
$dataAsset = $assetFactory->create([
   'controller' => CoverController::class,
   'parameters' => ['title' => 'My PDF', 'date' => new DateTime()],
   'cache_key' => 'cover',
   'cache_expires_after' => 3600,
   'cache_clear' => true, // use to purge any previously cached data
]);
```

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

[](#installation)

Use [Composer](https://getcomposer.org/) to install the library.

```
$ composer require endroid/asset
```

When you use Symfony, the [installer](https://github.com/endroid/installer)makes sure that services are automatically wired. If this is not the case you can find the configuration files in the `.install/symfony` folder.

Versioning
----------

[](#versioning)

Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatible changes will be kept to a minimum but be aware that these can occur. Lock your dependencies for production and test your code when upgrading.

License
-------

[](#license)

This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code.

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance83

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity93

Battle-tested with a long release history

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

Recently: every ~123 days

Total

39

Last Release

85d ago

Major Versions

1.0.1 → 2.0.02018-05-27

PHP version history (9 changes)1.0.0PHP &gt;=7.1

2.0.5PHP &gt;=7.2

2.2.0PHP ^7.4||^8.0

2.2.2PHP ^7.3||^8.0

2.5.0PHP ^8.0

2.5.1PHP ^8.1

2.6.0PHP ^8.2

2.7.0PHP ^8.3

2.7.1PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea3fc1b297f29579f9861b5fbe3240c0eeafaaaee6e39b45d85d612a04a52fbd?d=identicon)[endroid](/maintainers/endroid)

---

Top Contributors

[![endroid](https://avatars.githubusercontent.com/u/537253?v=4)](https://github.com/endroid "endroid (109 commits)")

---

Tags

endroidasset

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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