Skip to content

Instantly share code, notes, and snippets.

@migmolrod
migmolrod / config.yml
Created September 1, 2015 02:23
Adding a translatable language switcher to JMSI18nRoutingBundle
parameters:
locale: 'es_ES'
locales: [ 'de', 'en_GB', 'es_ES', 'fr' ]
jms_i18n_routing:
default_locale: %locale%
locales: %locales%
twig:
globals:
@migmolrod
migmolrod / UriPrefixVoter.php
Last active June 28, 2019 08:47
UriPrefixVoter for Sylius backend
<?php
// File: <project>/src/Voter/UriPrefixVoter.php
namespace App\Voter;
use Knp\Menu\ItemInterface;
use Knp\Menu\Matcher\Voter\VoterInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;