From 77f9a37b9ecb216753c0fbd7df17ad8352226f47 Mon Sep 17 00:00:00 2001 From: KevBurnsJr Date: Mon, 13 Jun 2011 00:12:04 -0700 Subject: [PATCH] Moving $orig_tags to render --- Mustache.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Mustache.php b/Mustache.php index 19e9cbb..b6b08e1 100644 --- a/Mustache.php +++ b/Mustache.php @@ -175,6 +175,9 @@ class Mustache { public function render($template = null, $view = null, $partials = null) { if ($template === null) $template = $this->_template; if ($partials !== null) $this->_partials = $partials; + + $otag_orig = $this->_otag; + $ctag_orig = $this->_ctag; if ($view) { $this->_context = array($view); @@ -183,7 +186,12 @@ class Mustache { } $template = $this->_renderPragmas($template); - return $this->_renderTemplate($template, $this->_context); + $template = $this->_renderTemplate($template, $this->_context); + + $this->_otag = $otag_orig; + $this->_ctag = $ctag_orig; + + return $template; } /** @@ -475,9 +483,6 @@ class Mustache { return $template; } - $otag_orig = $this->_otag; - $ctag_orig = $this->_ctag; - $first = true; $this->_tagRegEx = $this->_prepareTagRegEx($this->_otag, $this->_ctag, true); @@ -517,9 +522,6 @@ class Mustache { } } - $this->_otag = $otag_orig; - $this->_ctag = $ctag_orig; - return $html . $template; }