Updated render initialization code. Now passes $this as the view object unless an external view object is provided.
This commit is contained in:
+8
-1
@@ -54,9 +54,16 @@ class Mustache {
|
||||
*/
|
||||
public function render($template = null, $view = null, $partials = null) {
|
||||
if ($template === null) $template = $this->template;
|
||||
if ($view === null) $view = $this->view;
|
||||
if ($partials !== null) $this->partials = $partials;
|
||||
|
||||
if ($view === null) {
|
||||
if ($this->view) {
|
||||
$view = $this->view;
|
||||
} else {
|
||||
$view = $this;
|
||||
}
|
||||
}
|
||||
|
||||
$template = $this->renderSection($template, $view);
|
||||
return $this->renderTags($template, $view);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user