Exemplo n.º 1
0
 public function onKernelRequest(GetResponseEvent $event)
 {
     $request = $event->getRequest();
     $mediaType = $request->attributes->get('media_type');
     if (1 === preg_match($this->regex, $mediaType, $matches)) {
         $this->version = $matches['version'];
         $request->attributes->set('version', $this->version);
         if ($this->viewHandler instanceof ConfigurableViewHandlerInterface) {
             $this->viewHandler->setExclusionStrategyVersion($this->version);
         }
     }
 }