Created
February 25, 2016 19:22
-
-
Save zyphlar/ee268d646152cd1f5494 to your computer and use it in GitHub Desktop.
after-controller-response hooks in Symfony2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function myPostControllerFunction($someObject) { | |
$dispatcher = $this->get('event_dispatcher'); | |
$logger = $this->get('logger'); | |
$dispatcher->addListener('kernel.terminate', function ($event) use ($logger, $someObject) { | |
$logger->warning('This log entry was generated after Kernel Terminate and was passed an object of class: '.get_class($someObject)); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment