PHP Class Joli\GifExceptionBundle\EventListener\ReplaceImageListener

Datei anzeigen Open project: jolicode/GifExceptionBundle

Public Methods

Method Description
__construct ( array $gifs, string $exceptionController, Symfony\Component\Asset\Packages $packages = null, Symfony\Component\Templating\Helper\CoreAssetsHelper $coreAssetsHelper = null )
onKernelResponse ( FilterResponseEvent $event ) Handle the response for exception and replace the little Phantom by a random Gif.

Private Methods

Method Description
generateUrl ( string $url ) : string Generate an url in both Symfony 2 and Symfony 3 compatible ways.
getGifDir ( integer $statusCode ) : string Return the gif folder for the given status code.
getGifUrl ( string $dir, string $gif ) : string Return a the url of given gif in the given directory.
getRandomGif ( string $dir ) : string Return a random gif name for the given directory.

Method Details

__construct() public method

public __construct ( array $gifs, string $exceptionController, Symfony\Component\Asset\Packages $packages = null, Symfony\Component\Templating\Helper\CoreAssetsHelper $coreAssetsHelper = null )
$gifs array
$exceptionController string
$packages Symfony\Component\Asset\Packages
$coreAssetsHelper Symfony\Component\Templating\Helper\CoreAssetsHelper

onKernelResponse() public method

Handle the response for exception and replace the little Phantom by a random Gif.
public onKernelResponse ( FilterResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\FilterResponseEvent