for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the CMS Kernel package.
*
* Copyright (c) 2016-present LIN3S <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace LIN3S\CMSKernel\Infrastructure\Lin3sAdminBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
/**
* @author Beñat Espiña <[email protected]>
class LocaleController extends Controller
{
public function switchLocaleAction(Request $request)
$locale = $locale = $request->getLocale();
$request->getSession()->set('_locale', $locale);
$refererUrl = $request->headers->get('referer');
if (empty($refererUrl)) {
return $this->redirectToRoute('lin3s_admin_dashboard');
}
return $this->redirect($refererUrl);