php的TP5路由配置url的方式

在application文件下找到route.php在里面配置路由

use think\Route;
Route::rule('hello','samiple/test/hello');
http://z.cn:8080/hello访问方式即可访问,就像hello代理了 samiple/test/hello这个路径

路由的各种配置

//Route::rule('hello','samiple/test/hello','GET|POST',['https'=>false]);//代表即使是get还是post都能访问成功
Route::get('hello','samiple/test/hello');
//Route::any('hello','samiple/test/hello'); //代表所有的*号,即什么访问都能允许通过
//Route::post('hello','samiple/test/hello');
Route::rule('路由表达式','路由地址','请求类型','路由参数[数组的形式]','变量规则[数组的形式]');

猜你喜欢

转载自blog.csdn.net/qq_29109193/article/details/80919647