1:路由配置不支持在模块配置文件设置。
2:路由定义 application/route.php 文件里面配置
return [
// 添加路由规则 路由到 index控制器的hello操作方法
'hello/:name' => 'index/index/hello',
];
该路由规则表示所有hello开头的并且带参数的访问都会路由到index控制器的hello操作方法。
路由之前的URL访问地址为:
http://tp5.com/index/index/hello/name/thinkphp
定义路由后就只能访问下面的URL地址
http://tp5.com/hello/thinkphp
网友评论