68publishers / asset
Integration of Symfony's Asset component into Nette Framework.
Installs: 54 574
Dependents: 0
Suggesters: 1
Security: 0
Stars: 5
Watchers: 4
Forks: 3
Open Issues: 2
Requires
- php: ^7.4 || ^8.0
- latte/latte: ^2.5 || ^3.0
- nette/di: ^3.0.10
- nette/utils: ^3.2.5 || ^4.0
- symfony/asset: ^5.4 || ^6.0 || ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.13
- nette/application: ^3.1.0
- nette/bootstrap: ^3.1
- nette/tester: ^2.4.3
- phpstan/phpstan: ^1.9
- phpstan/phpstan-nette: ^1.1
- roave/security-advisories: dev-latest
Conflicts
- nette/schema: <1.2.0
README
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