Laravel通用路由,万能路由

Route::any('/{module}/{class}/{action}', function($module, $class, $action) {
    $ctrl = \App::make("\\App\\Http\\Controllers\\" . $module . "\\" . $class . "Controller");
    return \App::call([$ctrl, $action]);
});

  

posted @ 2018-02-03 11:00  lobtao  阅读(1176)  评论(0)    收藏  举报