Skip to content

Instantly share code, notes, and snippets.

@irwinv
Created June 25, 2012 19:03
Show Gist options
  • Save irwinv/2990554 to your computer and use it in GitHub Desktop.
Save irwinv/2990554 to your computer and use it in GitHub Desktop.
use Symfony\Component\HttpFoundation\RedirectResponse;
...
$route = $this->container->get('request')->get('_route');
$user = $this->container->get('security.context')->getToken()->getUser();
if($router == "myapp_accueil" && $user != "anon."){
$url = $this->container->get('router')->generate("myapp_espace_perso");
return new RedirectResponse($url);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment