html.php 585 B

1234567891011121314151617181920212223
  1. <?php
  2. class HTML {
  3. public static function script($path) {
  4. if(!file_exists($path)) return;
  5. $modified_time = filemtime($path);
  6. $src = preg_replace("/^public\//", "/", $path);
  7. ?>
  8. <script type="text/javascript" src="<?=htmlspecialchars($src)?>?<?=$modified_time?>"></script>
  9. <?php
  10. }
  11. public static function stylesheet($path) {
  12. if(!file_exists($path)) return;
  13. $modified_time = filemtime($path);
  14. $src = preg_replace("/^public\//", "/", $path);
  15. ?>
  16. <link rel="stylesheet" type="text/css" href="<?=htmlspecialchars($src)?>?<?=$modified_time?>"></link>
  17. <?php
  18. }
  19. }
  20. ?>