diff options
Diffstat (limited to 'functions.php')
| -rw-r--r-- | functions.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/functions.php b/functions.php index 9490c0d..85b0afc 100644 --- a/functions.php +++ b/functions.php @@ -75,3 +75,17 @@ array_push($views, $cid); } echo $row['views']; } +/** + * 自动生成引用 + */ +function generate_require($files,$type,$cdn = NULL) { + if ($cdn) + $path = $cdn.themeVersion()."/"; + else $path = Helper::options()->themeUrl("","Miracles"); + foreach ($files as $file) { + if ($type == "js") + echo "<script src=".$path."assets/".$type."/".$file.".".$type."></script>"; + elseif ($type == "css") + echo "<link rel=\"stylesheet\" href=".$path."assets/".$type."/".$file.".".$type." />"; + } +}
\ No newline at end of file |
