ソースを参照

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

Justin Hileman 15 年 前
コミット
c79501b4ad
1 ファイル変更1 行追加1 行削除
  1. 1 1
      Mustache.php

+ 1 - 1
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);
 	}