diff --git a/Mustache.php b/Mustache.php index 376a495..1ff5df3 100644 --- a/Mustache.php +++ b/Mustache.php @@ -25,11 +25,13 @@ class Mustache { /** * Mustache class constructor. * - * This method accepts a $template string and a $view object. + * This method accepts a $template string and a $view object. Optionally, pass an associative + * array of partials as well. * * @access public * @param mixed $template (default: null) * @param mixed $view (default: null) + * @param mixed $partials (default: null) * @return void */ public function __construct($template = null, $view = null, $partials = null) { @@ -42,16 +44,18 @@ class Mustache { * Render the given template and view object. * * Defaults to the template and view passed to the class constructor unless a new one is provided. - * + * Optionally, pass an associative array of partials as well. + * * @access public * @param string $template (default: null) * @param mixed $view (default: null) + * @param mixed $partials (default: null) * @return string Rendered Mustache template. */ public function render($template = null, $view = null, $partials = null) { if ($template === null) $template = $this->template; if ($view === null) $view = $this->view; - if ($partials === null) $partials = $this->partials; + if ($partials !== null) $this->partials = $partials; $template = $this->renderSection($template, $view); return $this->renderTags($template, $view);