TemplateInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2009 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. /**
  11. * Interface implemented by all compiled templates.
  12. *
  13. * @author Fabien Potencier <fabien@symfony.com>
  14. *
  15. * @deprecated since 1.12 (to be removed in 3.0)
  16. */
  17. interface Twig_TemplateInterface
  18. {
  19. const ANY_CALL = 'any';
  20. const ARRAY_CALL = 'array';
  21. const METHOD_CALL = 'method';
  22. /**
  23. * Renders the template with the given context and returns it as string.
  24. *
  25. * @param array $context An array of parameters to pass to the template
  26. *
  27. * @return string The rendered template
  28. */
  29. public function render(array $context);
  30. /**
  31. * Displays the template with the given context.
  32. *
  33. * @param array $context An array of parameters to pass to the template
  34. * @param array $blocks An array of blocks to pass to the template
  35. */
  36. public function display(array $context, array $blocks = array());
  37. /**
  38. * Returns the bound environment for this template.
  39. *
  40. * @return Twig_Environment The current environment
  41. */
  42. public function getEnvironment();
  43. }