Pragmas don't need to be re-rendered for all sub-templates (i.e. sections). Moving call to _renderPragmas into main render() method.

This commit is contained in:
Justin Hileman
2010-05-22 20:27:31 -04:00
parent 9e803ed033
commit c79501b4ad
+1 -1
View File
@@ -99,6 +99,7 @@ class Mustache {
$this->_context = array($this); $this->_context = array($this);
} }
$template = $this->_renderPragmas($template, $context);
return $this->_renderTemplate($template, $this->_context); return $this->_renderTemplate($template, $this->_context);
} }
@@ -128,7 +129,6 @@ class Mustache {
* @return string Rendered Mustache template. * @return string Rendered Mustache template.
*/ */
protected function _renderTemplate($template, &$context) { protected function _renderTemplate($template, &$context) {
$template = $this->_renderPragmas($template, $context);
$template = $this->_renderSection($template, $context); $template = $this->_renderSection($template, $context);
return $this->_renderTags($template, $context); return $this->_renderTags($template, $context);
} }