添加快捷路由支持

This commit is contained in:
thinkphp
2016-04-14 16:08:54 +08:00
parent 7b57db8ab1
commit c44369844a

View File

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