您的位置:首页 > 编程语言 > PHP开发

laravel 综合帖

2019-06-19 16:40 1676 查看
  1. 万能路由
Route::group(['namespace' => 'Movie', 'prefix' => 'movie', 'as' => 'movie.'], function () {
Route::any('{controller}/{action}', function ($controller, $action) {
$namespace =  Request::route()->getAction('namespace');
$uses = $namespace . '\\' . ucfirst($controller) . 'Controller@' . $action;
$name = $controller . '.' . $action;
return Request::route()->uses($uses)->name($name)->run();
});
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: