#config.yml services: myproject.security_switch_user: class: MyApp\AppBundle\Listener\SecuritySwitchUserListener tags: - { name: kernel.event_listener, event: security.switch_user, method: onSecuritySwitchUser }<?php// src/MyApp/AppBundle/Listener/SecuritySwitchUserListener.phpnamespace MyApp\AppBundle\Listener;use Symfony\Component\Security\Http\Event\SwitchUserEvent;class SecuritySwitchUserListener{public function onSecuritySwitchUser(SwitchUserEvent $event){$newUser = $event->getTargetUser();} }
Beware! I made typos, always. This is a multilingual blog, contains Turkish and English posts. Here my homepage without typos : hasantayyar.net - Blog moved to medium.com/@htayyar. Old posts will remain here.
Monday, August 25, 2014
Listen switch_user Event in #Symfony
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment