美文网首页
thinkphp5.0 路由

thinkphp5.0 路由

作者: chaofu | 来源:发表于2017-08-01 22:53 被阅读22次

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

相关文章

网友评论

      本文标题:thinkphp5.0 路由

      本文链接:https://www.haomeiwen.com/subject/ymeslxtx.html