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:
+1
-1
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user