From 6e5d83d513dbfd9044a3dc7ca4cc9e3cf3c11e0f Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 24 Oct 2016 18:13:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E8=B7=AF=E7=94=B1=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=B3=A8=E5=86=8C=E7=9A=84=E8=B7=AF=E7=94=B1=E8=A7=84?= =?UTF-8?q?=E5=88=99=20=E8=AE=B0=E5=BD=95=E5=BD=93=E5=89=8D=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84=20=E8=B5=84=E6=BA=90=E6=A0=87=E8=AF=86=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20=E8=B7=AF=E7=94=B1=E5=8F=82=E6=95=B0=20=20?= =?UTF-8?q?rest=20=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 2db507ed..c353c721 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -578,7 +578,8 @@ class Route } elseif (strpos($val[1], ':id') && isset($option['var'][$rule])) { $val[1] = str_replace(':id', ':' . $option['var'][$rule], $val[1]); } - $item = ltrim($rule . $val[1], '/'); + $item = ltrim($rule . $val[1], '/'); + $option['rest'] = $key; self::rule($item . '$', $route . '/' . $val[2], $val[0], $option, $pattern); } } @@ -637,7 +638,7 @@ class Route * rest方法定义和修改 * @access public * @param string $name 方法名称 - * @param array $resourece 资源 + * @param array $resource 资源 * @return void */ public static function rest($name, $resource = [])