| 123456789101112131415161718192021 |
- <?php
- class HTML {
- public static function script($path) {
- if(!file_exists($path)) return;
- $modified_time = filemtime($path);
- $src = preg_replace("/^public\//", "/", $path);
- ?>
- <script type="text/javascript" src="<?=htmlspecialchars($src)?>?<?=$modified_time?>"></script>
- <?php
- }
- public static function stylesheet($path) {
- if(!file_exists($path)) return;
- $modified_time = filemtime($path);
- $src = preg_replace("/^public\//", "/", $path);
- ?>
- <link rel="stylesheet" type="text/css" href="<?=htmlspecialchars($src)?>?<?=$modified_time?>" />
- <?php
- }
- }
|