From 6a5840b8e270e673d42f804138c2e4c3fa165e04 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 11 Dec 2015 10:25:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=88=AB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/route.php | 2 ++ library/think/url.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/library/think/route.php b/library/think/route.php index 08f5f7c2..56f4e1b0 100644 --- a/library/think/route.php +++ b/library/think/route.php @@ -28,6 +28,8 @@ class Route private static $domain = []; // 变量规则 private static $pattern = []; + // 路由别名 用于自动生成 + public static $alias = []; // 添加URL映射规则 public static function map($map, $route = '') diff --git a/library/think/url.php b/library/think/url.php index 022eaf0d..cf5b0ec1 100644 --- a/library/think/url.php +++ b/library/think/url.php @@ -99,7 +99,9 @@ class Url // 根据路由名称和参数生成URL地址 public static function route($name, $params) { + if (isset(Route::$alias[$name])) { + } } // 解析URL和参数 域名