summaryrefslogtreecommitdiff
path: root/libs/Utils.php
diff options
context:
space:
mode:
authorEltrac Koalar <hi@guhub.cn>2022-08-13 14:21:11 +0800
committerGitHub <noreply@github.com>2022-08-13 14:21:11 +0800
commitf8cefbddee3b1005d7af569e4fc89c3f6059c008 (patch)
tree8d731045d1be526ddafdf24e2cb2369f4a8b2c84 /libs/Utils.php
parent31e5c29c1a030d8f8d169b81386e659c1e2fb11f (diff)
init
Diffstat (limited to 'libs/Utils.php')
-rw-r--r--libs/Utils.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/libs/Utils.php b/libs/Utils.php
new file mode 100644
index 0000000..98ac6a7
--- /dev/null
+++ b/libs/Utils.php
@@ -0,0 +1,34 @@
+<?php
+if (!defined('__TYPECHO_ROOT_DIR__')) exit;
+
+/**
+ * Utils.php
+ * 辅助工具
+ */
+
+class Utils
+{
+ /**
+ * 输出相对首页路由,本方法会自适应伪静态,用于动态文件
+ */
+ public static function index($path = '')
+ {
+ Helper::options()->index($path);
+ }
+
+ /**
+ * 输出相对首页路径,本方法用于静态文件
+ */
+ public static function indexHome($path = '')
+ {
+ Helper::options()->siteUrl($path);
+ }
+
+ /**
+ * 输出相对主题目录路径,用于静态文件
+ */
+ public static function indexTheme($path = '')
+ {
+ Helper::options()->themeUrl($path);
+ }
+}