From d1637a9e51d0574655f4b3d3eefe7e3feea3ea47 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 24 Dec 2016 09:12:55 +0800 Subject: [PATCH] =?UTF-8?q?Route=E7=B1=BB=E7=9A=84rest=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=A6=86=E7=9B=96=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 6a6bac81..a37f0e17 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -663,14 +663,14 @@ class Route /** * rest方法定义和修改 * @access public - * @param string $name 方法名称 - * @param array $resource 资源 + * @param string $name 方法名称 + * @param array|bool $resource 资源 * @return void */ public static function rest($name, $resource = []) { if (is_array($name)) { - self::$rest = array_merge(self::$rest, $name); + self::$rest = $resource ? $name : array_merge(self::$rest, $name); } else { self::$rest[$name] = $resource; }