Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/68publishers/asset
📂 Intergration of Symfony's Assets component into Nette Framework
https://github.com/68publishers/asset
assets nette symfony
Last synced: 8 days ago
JSON representation
📂 Intergration of Symfony's Assets component into Nette Framework
- Host: GitHub
- URL: https://github.com/68publishers/asset
- Owner: 68publishers
- License: mit
- Created: 2019-05-20T21:54:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-06T00:44:32.000Z (3 months ago)
- Last Synced: 2024-10-07T06:53:56.713Z (29 days ago)
- Topics: assets, nette, symfony
- Language: PHP
- Homepage:
- Size: 58.6 KB
- Stars: 5
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Symfony Asset Component in Nette
Integration of symfony/asset into Nette Framework.
## Installation
The best way to install 68publishers/asset is using Composer:
```sh
$ composer require 68publishers/asset
```## Usage
Simply register a compiler extension into DIC:
```neon
extensions:
asset: SixtyEightPublishers\Asset\Bridge\Nette\DI\AssetExtensionasset:
# your configuration
```Configuration options are described in official [Symfony documentation](https://symfony.com/doc/6.0/reference/configuration/framework.html#assets)
## Usage in Latte templates
```latte
{* Use default package *}
Version: {asset_version 'my/awesome/image.png'}
{* Use "foo" package *}
Version: {asset_version 'my/awesome/image.png', 'foo'}
```You can also use a function equivalent. For example if you want to store result in variable:
```latte
{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
```bash
$ make init # to pull and start all docker images$ make cs.check
$ make stan
$ make tests.all
```