slamecka / timestamp
Adds n:src and n:href macros which append timestamp as a parameter to path (e.g. main.js?512a45c4)
Installs: 60
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 0
pkg:composer/slamecka/timestamp
Requires
- php: >=5.3.0
- nette/nette: 2.*
This package is not auto-updated.
Last update: 2025-10-11 19:49:03 UTC
README
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
MIT license