优化Route类的domain方法

This commit is contained in:
thinkphp
2016-08-23 14:47:26 +08:00
parent 7008e485c2
commit 9ac984d56c

View File

@@ -101,8 +101,7 @@ class Route
foreach ($domain as $key => $item) {
self::domain($key, $item, $option, $pattern);
}
} else {
if ($rule instanceof \Closure) {
} elseif ($rule instanceof \Closure) {
// 执行闭包
self::setDomain($domain);
call_user_func_array($rule, []);
@@ -117,7 +116,7 @@ class Route
} else {
self::$rules['domain'][$domain]['[bind]'] = [$rule, $option, $pattern];
}
}
}
private static function setDomain($domain)