PHP code example of phant / assets-versions

1. Go to this page and download the library: Download phant/assets-versions 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/ */

    

phant / assets-versions example snippets


use Phant\AssetsVersions\AssetsVersions;

$assetsVersions = new AssetsVersions(
	'public/', // path to be processed
	[ 'css', 'js' ], // extensions to be processed
	[ 'node_modules/' ] // path to be ignored in path to be processed
);

use Phant\AssetsVersions\AssetsVersions;
use Phant\Cache\SimpleCache;

$assetsVersions = new AssetsVersions(
	'public/', // path to be processed
	[ 'css', 'js' ], // extensions to be processed
	[ 'node_modules/' ], // path to be ignored in path to be processed
	new SimpleCache( '/my-cache-path/', 'my-app-cache', 30 * 86400 ) // cache adapter
);