instante / assets
This package is abandoned and no longer maintained.
No replacement package was suggested.
Instante assets adds useful macros to work with assets in www directory
v0.1.3
2017-05-02 06:01 UTC
Requires
- php: >=5.5.0
- latte/latte: ~2.4
- nette/caching: ~2.4
- nette/di: ~2.4
Requires (Dev)
This package is not auto-updated.
Last update: 2020-10-14 16:23:57 UTC
README
Useful macros for latte assets
Requirements
- PHP 5.6 or higher
- Nette Framework 2.4 or higher
Installation
The best way to install Instante assets is using Composer:
$ composer require instante/assets
Then add new extension to neon configuration
extensions: assets: Instante\Assets\DI\AssetsExtension
Usage
Instead of following code:
<link rel="stylesheet" href="{$basePath}/css/main.min.css">
you should use:
<link rel="stylesheet" href="{hashedAssetVersion 'css/main.min.css'}">
It will automatically generates MD5 hash of current asset to prevent unwanted caching. Hash is regenerated after 1 week or after you manually clear cache.
To simply prepend $basePath url to asset, you can use macro {asset 'path/to/file'}
.