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 = []) {