TwigRenderer.php 991 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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\Bridge\Twig\Form;
  11. use Symfony\Component\Form\FormRenderer;
  12. use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface;
  13. /**
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. class TwigRenderer extends FormRenderer implements TwigRendererInterface
  17. {
  18. /**
  19. * @var TwigRendererEngineInterface
  20. */
  21. private $engine;
  22. public function __construct(TwigRendererEngineInterface $engine, CsrfProviderInterface $csrfProvider = null)
  23. {
  24. parent::__construct($engine, $csrfProvider);
  25. $this->engine = $engine;
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function setEnvironment(\Twig_Environment $environment)
  31. {
  32. $this->engine->setEnvironment($environment);
  33. }
  34. }