Componette

Componette

68publishers

68publishers / asset v2.0

๐Ÿ“‚ Intergration of Symfony's Assets component into Nette Framework

download-cloud-line composer require 68publishers/asset

Symfony Asset Component in Nette

Build Status Quality Score Coverage Status Total Downloads Latest Version on Packagist

This package integrates symfony/asset into Nette Framework. Configuration is almost same as Symfony's configuration.

Installation

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

composer require 68publishers/asset

then you can register extension into DIC:

extensions:
    asset: SixtyEightPublishers\Asset\DI\AssetExtension

Confiugration

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 Filter/Helper equivalent. For example if you want to store result in variable:

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

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

Contributing

Before committing any changes, don't forget to run

vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run

and

vendor/bin/tester ./tests
  • v2.0 v2.0

    Upgrade to Nette 3.x

  • v1.1 v1.1 - Symfony 5 & PHP 7.2+

    • dropped support for PHP 7.1
    • supported versions ^4.2 and ^5.0 for Symfony Asset Component
    • improved coding style
    • improved CI configuration
  • v1.0.1 v1.0.1 - CI

    • added CI configurations
    • small/minority changes
  • v1.0 v1.0 - First release

    โœ”๏ธ Nette ^2.4
    โœ”๏ธ Symfony Assets ^4.2

bar-chart-fill

Statistics

download-cloud-fill
3748
star-fill
3
bug-fill
0
flashlight-fill
277d
price-tag-2-line

Badges

guide-fill

Dependencies

php (~7.1)
nette/di (~2.4)
Componette Componette felix@nette.org