Laravel

route设置###

//get写法 as 别名,可以用这获取这条路有的详细信息
Route::get('/', 'Sso\TestController@hello');
Route::get('user/profile', [
    'as' => 'profile', 'uses' => 'UserController@showProfile'
]);
//post写法 

//group写法,为了给一个集合的路径加上指定的 ‘中间器’
$app->group(['middleware' => 'foo|bar'], function($app)
{
    $app->get('/', function() {
        // Uses Foo & Bar Middleware
    });

    $app->get('user/profile', function() {
        // Uses Foo & Bar Middleware
    });
});

获取route路径###

$url = route('profile');

重定向###

$redirect = redirect()->route('profile');

posted @ 2016-03-03 12:15  UCanBeFree  阅读(112)  评论(0编辑  收藏  举报