route.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2016 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. //如果有定义绑定后台模块则禁用路由规则
  12. if (defined('BIND_MODULE') && BIND_MODULE == 'admin')
  13. return [];
  14. return [
  15. //别名配置,别名只能是映射到控制器且访问时必须加上请求的方法
  16. // '__alias__' => [
  17. // 'demo' => 'admin/Test',
  18. // ],
  19. '__pattern__' => [
  20. 'name' => '\w+',
  21. ],
  22. '[hello]' => [
  23. ':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
  24. ':name' => ['index/hello', ['method' => 'post']],
  25. ],
  26. // 域名绑定到模块
  27. // '__domain__' => [
  28. // 'admin' => 'admin',
  29. // 'api' => 'api',
  30. // ],
  31. ];