From c44369844a797c795f3a01b7a3281ed1485954e2 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 14 Apr 2016 16:08:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BF=AB=E6=8D=B7=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/library/think/Route.php b/library/think/Route.php index 9de102df..bcd40800 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -216,6 +216,15 @@ class Route } } + // 注册快捷路由 + public static function express($rule, $route = '', $option = [], $pattern = []) + { + $method = ['get', 'post', 'put', 'delete']; + foreach ($method as $type) { + self::$type($rule . '/:action', $route . '/' . $type . ':action', $option, $pattern); + } + } + // rest方法定义和修改 public static function rest($name, $resource = []) {