From d99edfc8f4203730c8fc38cf042846b09f11b3f6 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 26 Mar 2011 10:24:45 +0100 Subject: [PATCH] replaced the Twig_Environment::load() shortcut by a more useful render() one --- lib/Twig/Environment.php | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index 440a2f3..81262c8 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -269,9 +269,17 @@ class Twig_Environment return $this->templateClassPrefix; } - public function load($name) + /** + * Renders a template. + * + * @param string $name The template name + * @param array $context An array of parameters to pass to the template + * + * @return string The rendered template + */ + public function render($name, array $context = array()) { - return $this->loadTemplate($name); + return $this->loadTemplate($name)->render($context); } /** -- 1.7.2.5