instante/assets

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.
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

This package is not auto-updated.

Last update: 2020-10-14 16:23:57 UTC


README

Useful macros for latte assets

Build Status Downloads this Month Latest stable

Requirements

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