almeyda / fileversion
automatically timestamp file version based on the latest modification date
dev-master
2020-12-05 21:14 UTC
Requires
- php: >=5.5.0
This package is auto-updated.
Last update: 2026-03-06 09:01:17 UTC
README
Format file path by adding datetime segment if necessary.
Append the last modified timestamp to the file name in the form of [file_name]?v=[timestamp].
Installation
Add the extention using composer:
"almeyda/fileversion": "*"
Usage
<link rel="stylesheet" type="text/css" href="<?php echo \almeyda\fileversion\src\FileVersion::set('pathToCssFileFromTheRoot'); ?>"> <img src="<?php echo \almeyda\fileversion\src\FileVersion::set('pathToImgFileFromTheRoot'); ?>"> <script src="<?php echo \almeyda\fileversion\src\FileVersion::set('pathToJsFileFromTheRoot'); ?>"></script>