for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Victoire\Bundle\I18nBundle\Listener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
/**
* KernelRequestListener add the available locas as global twig variable.
*
* @author Paul Andrieux <[email protected]>
*/
class KernelRequestListener
{
protected $twig;
protected $availableLocales;
public function __construct(\Twig_Environment $twig, $availableLocales)
$this->twig = $twig;
$this->availableLocales = $availableLocales;
}
public function onKernelRequest(GetResponseEvent $event)
$event
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$this->twig->addGlobal('victoire_i18n_available_locales', $this->availableLocales);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.