Route.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\facade;
  12. use think\Facade;
  13. /**
  14. * @see \think\Route
  15. * @mixin \think\Route
  16. * @method \think\route\Domain domain(mixed $name, mixed $rule = '', array $option = [], array $pattern = []) static 注册域名路由
  17. * @method \think\Route pattern(mixed $name, string $rule = '') static 注册变量规则
  18. * @method \think\Route option(mixed $name, mixed $value = '') static 注册路由参数
  19. * @method \think\Route bind(string $bind) static 设置路由绑定
  20. * @method mixed getBind(string $bind) static 读取路由绑定
  21. * @method \think\Route name(string $name) static 设置当前路由标识
  22. * @method mixed getName(string $name) static 读取路由标识
  23. * @method void setName(string $name) static 批量导入路由标识
  24. * @method void import(array $rules, string $type = '*') static 导入配置文件的路由规则
  25. * @method \think\route\RuleItem rule(string $rule, mixed $route, string $method = '*', array $option = [], array $pattern = []) static 注册路由规则
  26. * @method void rules(array $rules, string $method = '*', array $option = [], array $pattern = []) static 批量注册路由规则
  27. * @method \think\route\RuleGroup group(string|array $name, array|\Closure $route, array $method = '*', array $option = [], array $pattern = []) static 注册路由分组
  28. * @method \think\route\RuleItem any(string $rule, mixed $route, array $option = [], array $pattern = []) static 注册路由
  29. * @method \think\route\RuleItem get(string $rule, mixed $route, array $option = [], array $pattern = []) static 注册路由
  30. * @method \think\route\RuleItem post(string $rule, mixed $route, array $option = [], array $pattern = []) static 注册路由
  31. * @method \think\route\RuleItem put(string $rule, mixed $route, array $option = [], array $pattern = []) static 注册路由
  32. * @method \think\route\RuleItem delete(string $rule, mixed $route, array $option = [], array $pattern = []) static 注册路由
  33. * @method \think\route\RuleItem patch(string $rule, mixed $route, array $option = [], array $pattern = []) static 注册路由
  34. * @method \think\route\Resource resource(string $rule, mixed $route, array $option = [], array $pattern = []) static 注册资源路由
  35. * @method \think\Route controller(string $rule, mixed $route, array $option = [], array $pattern = []) static 注册控制器路由
  36. * @method \think\Route alias(string $rule, mixed $route, array $option = [], array $pattern = []) static 注册别名路由
  37. * @method \think\Route setMethodPrefix(mixed $method, string $prefix = '') static 设置不同请求类型下面的方法前缀
  38. * @method \think\Route rest(string $name, array $resource = []) static rest方法定义和修改
  39. * @method \think\Route\RuleItem miss(string $route, string $method = '*', array $option = []) static 注册未匹配路由规则后的处理
  40. * @method \think\Route\RuleItem auto(string $route) static 注册一个自动解析的URL路由
  41. * @method \think\Route\Dispatch check(string $url, string $depr = '/', bool $must = false, bool $completeMatch = false) static 检测URL路由
  42. */
  43. class Route extends Facade
  44. {
  45. /**
  46. * 获取当前Facade对应类名(或者已经绑定的容器对象标识)
  47. * @access protected
  48. * @return string
  49. */
  50. protected static function getFacadeClass()
  51. {
  52. return 'route';
  53. }
  54. }