markdown.php 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) Fabien Potencier
  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 Twig\Extra\Markdown\DefaultMarkdown;
  12. use Twig\Extra\Markdown\MarkdownExtension;
  13. use Twig\Extra\Markdown\MarkdownRuntime;
  14. return static function (ContainerConfigurator $container) {
  15. $service = function_exists('Symfony\Component\DependencyInjection\Loader\Configurator\service') ? 'Symfony\Component\DependencyInjection\Loader\Configurator\service' : 'Symfony\Component\DependencyInjection\Loader\Configurator\ref';
  16. $container->services()
  17. ->set('twig.extension.markdown', MarkdownExtension::class)
  18. ->tag('twig.extension')
  19. ->set('twig.runtime.markdown', MarkdownRuntime::class)
  20. ->args([
  21. $service('twig.markdown.default'),
  22. ])
  23. ->tag('twig.runtime')
  24. ->set('twig.markdown.default', DefaultMarkdown::class)
  25. ;
  26. };