/** * Load a template file -- first look in the templates folder for an override * * [!] Override to wrap html view in mail template * * @param string $tpl The name of the template source file; automatically searches the template paths and compiles as needed. * @return string The output of the the template script. */ public function loadTemplate($tpl = null) { // hold reference to template passed in $template = $tpl === false ? null : $tpl; // call load template and hold on to content $content = parent::loadTemplate($template); // if we want to wrap in mail template if ($tpl !== false) { $this->_mailTemplate->setBuffer($content, 'component'); $content = $this->_mailTemplate->render(); //$this->_mailTemplate->setBuffer(null, array('type' => 'head', 'name' => 'email')); $this->_mailTemplate->setBuffer(null, 'component'); $this->_mailTemplate->setBuffer(null, 'head'); } // return content return $content; }