朱纯树博客
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解决办法

评论 20

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

    hey there and thank you for your info – I’ve definitely picked up something new from right here.
    I did however expertise some technical issues using this website, as I experienced to reload the website lots of
    times previous to I could get it to load properly.
    I had been wondering if your web host is OK?
    Not that I’m complaining, but sluggish loading instances times will often affect your placement
    in google and could damage your high-quality score if advertising and marketing with Adwords.

    Anyway I’m adding this RSS to my e-mail and can look out for a lot more of your respective intriguing content.

    Ensure that you update this again very soon.

    Here is my web-site: tracfone coupon

    tracfone coupon1周前 (11-27)回复
  2. #29

    I like the helpful info you provide in your articles.
    I’ll bookmark your weblog and check again here regularly. I am quite sure I’ll learn many new stuff right here!
    Best of luck for the next!

    tinyurl.com4个月前 (08-15)回复
  3. #28

    This website definitely has all of the information I needed about this subject and didn’t know who to ask.

    http://tinyurl.com4个月前 (08-13)回复
  4. #27

    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.com4个月前 (08-03)回复
  5. #26

    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.com4个月前 (08-01)回复