Skip to content

Instantly share code, notes, and snippets.

@ahilles107
Created March 11, 2016 22:02
Show Gist options
  • Save ahilles107/ad24edf1128e4d31d50e to your computer and use it in GitHub Desktop.
Save ahilles107/ad24edf1128e4d31d50e to your computer and use it in GitHub Desktop.
ViewResponseListener return false asap when request is not covered by zone
public function onKernelView(GetResponseForControllerResultEvent $event)
{
$request = $event->getRequest();
if (!$request->attributes->get(FOSRestBundle::ZONE_ATTRIBUTE, true)) {
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment