GlobalVariables.php 878 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the Sonata package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\UserBundle\Twig;
  11. use Symfony\Component\DependencyInjection\ContainerInterface;
  12. /**
  13. * GlobalVariables
  14. *
  15. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  16. */
  17. class GlobalVariables
  18. {
  19. protected $container;
  20. /**
  21. * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
  22. */
  23. public function __construct(ContainerInterface $container)
  24. {
  25. $this->container = $container;
  26. }
  27. /**
  28. * @return string
  29. */
  30. public function getImpersonatingRoute()
  31. {
  32. return $this->container->getParameter('sonata.user.impersonating_route');
  33. }
  34. }