From d10966132b34076d67aa2d5ed07d66217db106c4 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 17 Oct 2011 13:01:40 +0200 Subject: [PATCH] added Twig_Environment::display() --- CHANGELOG | 1 + lib/Twig/Environment.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 84b314b..c388205 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ * 1.4.0 + * added Twig_Environment::display() * made the escape filter smarter when the encoding is not supported by PHP * added a convert_encoding filter * moved all node manipulations outside the compile() Node method diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index 27fd62f..fe04c2e 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -283,6 +283,17 @@ class Twig_Environment } /** + * Displays a template. + * + * @param string $name The template name + * @param array $context An array of parameters to pass to the template + */ + public function display($name, array $context = array()) + { + $this->loadTemplate($name)->display($context); + } + + /** * Loads a template by name. * * @param string $name The template name -- 1.7.2.5