Created
August 23, 2012 11:08
-
-
Save bamarni/3435623 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\Bundle\DemoBundle\Voter; | |
use Knp\Menu\ItemInterface; | |
use Knp\Menu\Silex\Voter\RouteVoter as BaseRouteVoter; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
/** | |
* {@inheritdoc} | |
*/ | |
class RouteVoter extends BaseRouteVoter | |
{ | |
public function __construct(ContainerInterface $container) | |
{ | |
$this->setRequest($container->get('request')); | |
} | |
} | |
<!-- src/Acme/Bundle/DemoBundle/Resources/config/services.xml --> | |
<service id="acme.menu.voter.route" class="Acme\Bundle\DemoBundle\Voter\RouteVoter" public="false"> | |
<tag name="knp_menu.voter" /> | |
<argument type="service" id="service_container" /> | |
</service> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment