This is the how to for redirection implementation by roles after login or logout in Symfony2
- Copy
AfterLoginRedirection.php
andAfterLogoutRedirection.php
to your bundle under the "Redirection" directory - Edit your
services.yml
file in your bundle and copy/paste the content ofservices.yml
- Edit your
security.yml
file... - ... add
success_handler: redirect.after.login
inform_login:
section - ... add
success_handler: redirect.after.logout
inlogout:
section
For more informations, you can read my explanation on my blog (in french only)
Followed your steps and get this error
There is no extension able to load the configuration for "redirect.after.login" (in /opt/local/apache2/tpp/src/Tundra/Bundle/PayrollBundle/DependencyInjection/../Resources/config/services.yml). Looked for namespace "redirect.after.login", found none
Anyone else see this?