Exemplo n.º 1
0
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
/**
 */
Route::get('/', function () {
    return View::make('public.pages.home');
});
//	>>> Языки
Route::any('/changelanguage/{lang}', function ($lang) {
    //для кнопочек переключения
    Session::put('lang', $lang);
    if (!empty(Session::get('id'))) {
        $userlang = LanguageController::changeProfileLang($lang);
    }
    $myurl = LanguageController::setBestLanguage($lang);
    return Redirect::to($myurl);
});
Route::group(array('prefix' => '{lang}'), function ($lang) {
    //для безболезненной смены ru/en ручками
    $myurl = LanguageController::lightLang();
    return Redirect::to($myurl);
});
Route::group(array('prefix' => Session::get('lang')), function () {
    //просто префикс
    Route::get('/', function () {
        return View::make('public.pages.home');
    });
    Route::get('/sing-up', 'UsersController@newUserRegister');