Componette

Componette

68publishers

68publishers / asset v3.3.1

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

download-cloud-line composer require 68publishers/asset

Symfony Asset Component in Nette

Integration of symfony/asset into Nette Framework.

Installation

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

$ composer require 68publishers/asset

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')}

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
  • v3.3.1 v3.3.1

    Changes

    • Makefile is excluded from an export
  • v3.3.0 v3.3.0

    Namespace changes + better Latte registration

    โ— BC breaks

    • please change a namespace of a compiler extension in your config.neon

    From: SixtyEightPublishers\Asset\DI\AssetExtension
    To: SixtyEightPublishers\Asset\Bridge\Nette\DI\AssetExtension

    Changes:

    • changed namespace of AssetExtension
    • all Latte stuff (macros, functions, providers) is now better registered in DIC
    • updated README
  • v3.2.1 v3.2.1

    Latte functions asset and asset_version โ˜•

    Changes

    • added latte functions asset and asset_version
    • removed unusable latte filters |asset and |asset_version
    • updated the section Usage in Latte templates in the README
  • v3.2.0 v3.2.0

    Configuration option strict_mode

    โ— BC breaks

    • dropped support for symfony/asset in the version 4.x, minimal required version is 5.4

    Added

    • added the configuration option strict_mode for the main and nested packages

    Development

    • added new assertions in tests
  • v3.1.0 v3.1.0

    Latte 3 support โ˜•

    Changes

    • added support for both Latte versions - ^2.5 and ^3.0
    • updated the section Usage in Latte templates in the README

    Development

    • added tests for latte filters
    • updated PHPStan configuration
  • v3.0.0 v3.0.0

    • Supported PHP versions are between 7.4 and 8.2
    • Bumped supported version of symfony/asset to ^4.0 | ^5.0 | ^6.0
    • The compiler extension has been completely refactored
    • Added more tests
    • Added GitHub actions
    • Added PHPStan
  • v2.1.0 v2.1.0

  • 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
13938
star-fill
3
bug-fill
0
flashlight-fill
62d
price-tag-2-line

Badges

guide-fill

Dependencies

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