朱纯树博客
VPS测评推荐网站
cloudacead cloudacead

[记录]TP5.1路由报错Non-static method thinkRoute::get() should not be called statically解决办法

TP5.1 和 TP5的版本 目录结构不太一样
TP5.1的路由文件是独立的一个文件夹
在使用的时候写入以下代码:

use thinkRoute;
Route::get('/',function (){
    return 'hello world';
});

会报以下错误:

ErrorException in route.PHP line 15
Non-static method thinkRoute::get() should not be called statically

解决办法是注释掉 use thinkRoute; 即可.

虽然不知道为什么会这样…但确实注释掉就可以了, 比较鸡肋…

记录一哈.
-End-

文章来源于互联网:[记录]TP5.1路由报错Non-static method thinkRoute::get() should not be called statically解决办法

赞(0) 打赏
未经允许不得转载:VPS测评推荐网站 - 朱纯树博客 » [记录]TP5.1路由报错Non-static method thinkRoute::get() should not be called statically解决办法

评论 17

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #30

    Heya! I’m at work surfing around your blog from my new iphone!
    Just wanted to say I love reading your blog and look forward to all your posts!

    Carry on the fantastic work!

    tinyurl.com1周前 (08-03)回复
  2. #29

    Wonderful goods from you, man. I’ve understand
    your stuff previous to and you’re just extremely wonderful.
    I really like what you’ve acquired here, really like what
    you’re stating and the way in which you say it. You make it entertaining and you still take care of to keep it sensible.
    I can’t wait to read far more from you. This is really a wonderful web site.

    tinyurl.com1周前 (08-01)回复