Created
April 25, 2020 20:07
-
-
Save alexsoin/0829fa5538262eef7ce99c3f4777dfc6 to your computer and use it in GitHub Desktop.
Вывод версии покдключаемого файла в modx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
И использовать его как-то так: | |
<link rel="stylesheet" href="{'public/template/css/styles.css' | version}" type="text/css"/> | |
<script src="{'public/template/js/scripts.min.js' | version}" type="text/javascript"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$filepath = MODX_BASE_PATH . $input; | |
if (file_exists($filepath)) { | |
return $input . '?v=' . date('dmYHis', filemtime($filepath)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment