templating_twig.php 1012 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  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 Symfony\Component\DependencyInjection\Loader\Configurator;
  11. use Symfony\Bridge\Twig\Extension\LogoutUrlExtension;
  12. use Symfony\Bridge\Twig\Extension\SecurityExtension;
  13. return static function (ContainerConfigurator $container) {
  14. $container->services()
  15. ->set('twig.extension.logout_url', LogoutUrlExtension::class)
  16. ->args([
  17. service('security.logout_url_generator'),
  18. ])
  19. ->tag('twig.extension')
  20. ->set('twig.extension.security', SecurityExtension::class)
  21. ->args([
  22. service('security.authorization_checker')->ignoreOnInvalid(),
  23. service('security.impersonate_url_generator')->ignoreOnInvalid(),
  24. ])
  25. ->tag('twig.extension')
  26. ;
  27. };