Routes And Closures 

주의 사항

  • named route 시 실제 구현 코드는 라우트 지정보다 아래에 와야 한다.

    # / 요청시 profile_r 로 라우트
    Route::get('/', function()
    {
    	return Redirect::to_route('profile_r');	
    });
    
    
    // 이 코드가 위 코드 보다 위에 있으면 404 에러가 발생함
    // account/profile 에 대한 route 를 profile_r 로 alias
    Route::get('account/profile', array('as' => 'profile_r' , 'do' => function()
    {
    	return View::make('account/profile');
    }	
    ));
    PHP

 

참고 자료