laravel5.2总结--路由
1 基本路由 1.1 定义路由的文件 app/Http/routes.php 1.2 最基本的路由: Route::get(''index", function () { return "hello world"; } 可用的路由方法: Route::get($uri, $callback); Route::post($uri, $callback); Route::put($uri, $callback); Route::patch($uri, $callback); Route::delete($uri, $callback); Route::options($uri, $callback); 1.3 一个可以响应多个HTTP动作的路由: Route::match(['get', 'post'], '/', function () { // }); Route::any('foo', function () { // }); 2 路由参数 2.1 必选参数 Route::get('user/{id}', function ($id) { return 'User '.$id; }); Route::get('posts/{post}/comments/{comment}', function ($postId, $commentId) { // }); 注意: 路由参数不能包含