PHP code example of cjrasmussen / static-file-versioning
1. Go to this page and download the library: Download cjrasmussen/static-file-versioning library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cjrasmussen / static-file-versioning example snippets
use cjrasmussen\StaticFileVersioning\FileVersion;
$fileVersion = new FileVersion('/path/to/config/file.json');
$fileVersion->set('styles.css', '-v1234');
$fileVersion->save();
use cjrasmussen\StaticFileVersioning\FileVersion;
$fileVersion = new FileVersion('/path/to/config/file.json');
echo 'styles' . $fileVersion->get('styles.css') . '.css';
// output: styles-v1234.css