vendor/symfony/assetic-bundle/EventListener/RequestListener.php line 23

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony framework.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Symfony\Bundle\AsseticBundle\EventListener;
  11. use Symfony\Component\HttpKernel\Event\GetResponseEvent;
  12. /**
  13.  * Adds a few formats to each request.
  14.  *
  15.  * @author Kris Wallsmith <kris@symfony.com>
  16.  */
  17. class RequestListener
  18. {
  19.     public function onKernelRequest(GetResponseEvent $event)
  20.     {
  21.         $request $event->getRequest();
  22.         $request->setFormat('png''image/png');
  23.         $request->setFormat('jpg''image/jpeg');
  24.         $request->setFormat('gif''image/gif');
  25.         $request->setFormat('svg''image/svg+xml');
  26.     }
  27. }