/TimestampMacro

Adds n:src and n:href macros to Nette\Latte templating engine. These macros append timestamp as a parameter to path (e.g. main.js?512a45c4)

Primary LanguagePHP

Adds macros n:src and n:href

<script n:src="/main.js"></script>
<link n:href="style.css">

to produce code similar to

<script src="/main.js?512a45c4"></script>
<link href="style.css?512a45c4">

where 512a45c4 is timestamp which automatically changes when you modify the file (it is filesystem's mtime).

Please note that you don't have to & can't use {$basePath} with these macros because every path is constructed as $basePath . '/' . $fileName.

Install

$ composer require slamecka/timestamp:dev-master

In your config.neon

nette:
	latte:
		macros:
			- TimestampMacro

Without license - Public Domain