adt / version-macro
Latte version macro for Nette Framework.
Installs: 49 626
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 18
Forks: 0
Open Issues: 0
Requires
- latte/latte: ^2.2
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 in123
<script type="text/javascript" src="/js/myJsFile{v}"></script> <script type="text/javascript" src="/js/myJsFile?v={vn}"></script>