Skip to content
πŸ“‚ Intergration of Symfony's Assets component into Nette Framework
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitattributes
.gitignore
.php_cs.dist
.scrutinizer.yml
.travis.yml
LICENSE.md
README.md
composer.json

README.md

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
You can’t perform that action at this time.