thinkPHP问题记录

  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');
    
+ 而按照下面的顺序则两种链接均可正确传值
 ```php
     Route::get('hello/[:name]', 'index/hello');
     Route::get('hello-<name>', 'index/hello');
 ```
2.  路由后找不到模板文件
+ 加上下面的语句会提示找不到模板,但是去掉 `@` 就好了,不知道加不加 `@` 有什么区别
 ```php
     Route::get('he', '@entry/ctrl/hell');
 ```
3.  ![](https://img2018.cnblogs.com/blog/1332505/201811/1332505-20181101180705101-1410377973.png)
posted @ 2018-10-30 20:12  l_____py  阅读(240)  评论(0编辑  收藏  举报