改进Route类

This commit is contained in:
thinkphp
2017-03-13 15:01:53 +08:00
parent 51f4e47dbe
commit 75beb3f424

View File

@@ -1057,7 +1057,7 @@ class Route
if (!empty($array[1])) {
self::parseUrlParams($array[1]);
}
return ['type' => 'method', 'method' => [$class, $action]];
return ['type' => 'method', 'method' => [$class, $action], 'var' => []];
}
/**
@@ -1077,7 +1077,7 @@ class Route
if (!empty($array[2])) {
self::parseUrlParams($array[2]);
}
return ['type' => 'method', 'method' => [$namespace . '\\' . Loader::parseName($class, 1), $method]];
return ['type' => 'method', 'method' => [$namespace . '\\' . Loader::parseName($class, 1), $method], 'var' => []];
}
/**
@@ -1096,7 +1096,7 @@ class Route
if (!empty($array[1])) {
self::parseUrlParams($array[1]);
}
return ['type' => 'controller', 'controller' => $controller . '/' . $action];
return ['type' => 'controller', 'controller' => $controller . '/' . $action, 'var' => []];
}
/**