almeyda/fileversion

automatically timestamp file version based on the latest modification date

Installs: 15

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:php-extension

dev-master 2020-12-05 21:14 UTC

This package is auto-updated.

Last update: 2024-05-06 04:37:50 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>