laravel 控制器多个方法共用一个路由

直接上代码:

Route::get('Index/{action}', function(App\Http\Controllers\IndexController $index, $action){
    return $index->$action();
});

 

 

控制器的其他使用和应用,请参考:http://laravelacademy.org/post/5866.html

posted @ 2017-01-10 17:05  Tiac  阅读(4381)  评论(0编辑  收藏  举报