From c79501b4ad4af630578a13e7c9ceb4bae0da2439 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 22 May 2010 20:27:31 -0400 Subject: [PATCH] Pragmas don't need to be re-rendered for all sub-templates (i.e. sections). Moving call to _renderPragmas into main render() method. --- Mustache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mustache.php b/Mustache.php index 36c0a87..e5567c9 100644 --- a/Mustache.php +++ b/Mustache.php @@ -99,6 +99,7 @@ class Mustache { $this->_context = array($this); } + $template = $this->_renderPragmas($template, $context); return $this->_renderTemplate($template, $this->_context); } @@ -128,7 +129,6 @@ class Mustache { * @return string Rendered Mustache template. */ protected function _renderTemplate($template, &$context) { - $template = $this->_renderPragmas($template, $context); $template = $this->_renderSection($template, $context); return $this->_renderTags($template, $context); }