码迷,mamicode.com
首页 > Web开发 > 详细

thinkPHP问题记录

时间:2018-10-30 21:24:38      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:顺序   host   无法   public   think   两种   去掉   http   cal   

  1. 路由组合变量问题
  • 按照下面的顺序 http://localhost/tp5/public/hello-dfggfqw21321 变量 name 会无法正确传递,但 http://localhost/tp5/public/hello/dfggfqw21321可以

        Route::get(‘hello/[:name]‘, ‘index/hello‘);
        Route::get(‘hello-<name>‘, ‘index/hello‘);
  • 而按照下面的顺序则两种链接均可正确传值

        Route::get(‘hello/[:name]‘, ‘index/hello‘);
        Route::get(‘hello-<name>‘, ‘index/hello‘);
  1. 路由后找不到模板文件
  • 加上下面的语句会提示找不到模板,但是去掉 @ 就好了,不知道加不加 @ 有什么区别

        Route::get(‘he‘, ‘@entry/ctrl/hell‘);

thinkPHP问题记录

标签:顺序   host   无法   public   think   两种   去掉   http   cal   

原文地址:https://www.cnblogs.com/liupy/p/9879200.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!