thinkphp5路由问题

浏览:3464 发布日期:2016/09/19 分类:ThinkPHP5专区 关键字: 路由
1、use think\Route;
Route::get('/',function(){
    return 'Hello,world!';
});
---------
这段添加到route.php中,访问/,还是欢迎界面啊,不是hello,world!求解
2、
在index模块的index控制器中添加test和hello方法   public function test()
    {
        return "hello world!!331";
         // dump(config());
    }

    public function hello()
    {
        return 'my is hello controller';
    }
然后在route.php中添加return [
    'test'   =>'test',
    'hello'   =>'hello',
 ];
然后在访问http://127.0.0.1/hello和http://127.0.0.1/test
可以直接输出test和hello方法的结果
my is hello controller
hello world!!331

求解,官方手册中没有提起这种用法啊?巧合吗?
最佳答案
评论() 相关
后面还有条评论,点击查看>>