1. url path format of tp5
http://主机名/入口文件/模块/控制器/controller/操作(方法)/参数
like:
The file structure is as follows:
Corresponding access domain name:
http://localhost/flavioy/public/index.php/sample/test/hello
2. Simplification of URL paths
1. Write a directory
application文件夹下的route.php
2. Calling method: dynamic registration
//使用Route类
use think\Route;
//调用rule方法
Route::rule('hello','sample/Test/hello');
//将后缀sample/Test/hello简化为hello
//完整参数
Route::rule('路由表达式','路由地址','请求类型','路由参数(数组)','标量规则');
域名由http://localhost/flavioy/public/index.php/sample/test/hello
简化为http://localhost/flavioy/public/index.php/hello