Search by

Integration of Symfony's Asset component into Nette Framework.

Package info

github.com/68publishers/asset

pkg:composer/68publishers/asset

Statistics

Installs: 93 733

Dependents: 0

Suggesters: 1

Stars: 5

Open Issues: 1

v4.0.0 2026-11-03 16:50 UTC

This package is auto-updated.

Last update: 2026-11-03 16:50:42 UTC


README

Integration of symfony/asset into Nette Framework.

Checks Coverage Status Total Downloads Latest Version PHP Version

Installation

The best way to install 68publishers/asset is using Composer:

$ composer require 68publishers/asset

The package requires PHP ^8.3, Latte ^3.0 and symfony/asset ^5.4 || ^6.0 || ^7.0 || ^8.0.

Usage

Simply register a compiler extension into DIC:

extensions:
	asset: SixtyEightPublishers\Asset\Bridge\Nette\DI\AssetExtension

asset:
	# your configuration

Configuration options are described in official Symfony documentation

Usage in Latte templates

{* Use default package *}
<img src="{asset 'my/awesome/image.png'}" alt="..."></a>
<p>Version: {asset_version 'my/awesome/image.png'}</p>


{* Use "foo" package *}
<img src="{asset 'my/awesome/image.png', 'foo'}" alt="..."></a>
<p>Version: {asset_version 'my/awesome/image.png', 'foo'}</p>

You can also use a function equivalent. For example if you want to store result in variable:

{var $asset = asset('my/awesome/image.png')}
{var $asset = asset('my/awesome/image.png', 'foo')}

{var $version = asset_version('my/awesome/image.png')}
{var $version = asset_version('my/awesome/image.png', 'foo')}

Upgrade

3.x → 4.0

  • The minimal PHP version is 8.3.
  • Latte 2 is no longer supported, the classes AssetLatte2Extension and AssetMacroSet are removed.
  • The option version must be a string, an integer or a float, other values (e.g. a boolean) are an invalid configuration. Previously they were cast to a string.

Contributing

Before opening a pull request, please check your changes using the following commands

$ make init # to pull and start all docker images

$ make cs.check
$ make stan
$ make tests.all