thinkphp URL 路径格式
http://serverName/index.php/module/controller/action/[param/value...]
http://localhost/tp5/public/index.php/index/index/index
[对于某些环境不支持]
兼容模式
http://serverName/index.php?s=module/controller/action/p/v...
缺点
- 太长
- URL路径暴露出服务器文件结构
- 不够灵活
- 不能很好的支持URL语义化(最大缺陷)
tp5自定义路由 Route.php
路由模式
Route::rule('路由表达式','路由地址','请求类型','路由参数(数组)','变量规则(数组)')
请求类型
类型 | 描述 | 快捷方法 |
---|---|---|
GET | GET请求 | get |
POST | POST请求 | post |