adt/version-macro

This package is abandoned and no longer maintained. No replacement package was suggested.

Latte version macro for Nette Framework.

v5.0 2022-02-05 14:42 UTC

This package is auto-updated.

Last update: 2022-06-05 15:18:19 UTC


README

Returns file modification time, which can be used for versioning css/js files or other assets.

Installation

The best way to install is using Composer:

$ composer require adt/version-macro

common.neon:

services:
	versionMacro: ADT\VersionMacro\VersionMacro

latte:
	macros:
		- @ADT\VersionMacro\VersionMacro::install

remote.neon:

services:
	versionMacro:
		setup:
			- setTimestampFile(%timestampFile%)

Without setting timestamp file, version macro returns empty string.

Usage

  • {v} - results in ?v=123
  • {vn} - results in 123
<script type="text/javascript" src="/js/myJsFile{v}"></script>
<script type="text/javascript" src="/js/myJsFile?v={vn}"></script>