From e7058fc1d594dd62bff9d03f18b9aed95ce257a3 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Mon, 22 Mar 2010 18:01:26 -0400 Subject: [PATCH] Fixed initialization for template and partials to avoid thunking defaults added by subclasses. --- Mustache.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Mustache.php b/Mustache.php index 90889b6..89b304d 100644 --- a/Mustache.php +++ b/Mustache.php @@ -18,9 +18,9 @@ class Mustache { public $ctag = '}}'; protected $tagRegEx; - protected $template; - protected $context; - protected $partials; + protected $template = ''; + protected $context = array(); + protected $partials = array(); /** * Mustache class constructor. @@ -35,12 +35,9 @@ class Mustache { * @return void */ public function __construct($template = null, $view = null, $partials = null) { - $this->template = $template; - $this->partials = $partials; - - if ($view) { - $this->context = array($view); - } + if ($template !== null) $this->template = $template; + if ($partials !== null) $this->partials = $partials; + if ($view !== null) $this->context = array($view); } /**