From: Fabien Potencier Date: Mon, 17 Oct 2011 11:01:40 +0000 (+0200) Subject: added Twig_Environment::display() X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=d10966132b34076d67aa2d5ed07d66217db106c4;p=web%2Fkonrad%2Ftwig.git added Twig_Environment::display() --- 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