/** * The default render() doesn't work here * @return null|string */ public function render() { // render specific template id if cache_id is set if ($this->smarty->cache_id) { $this->content = $this->smarty->fetch($this->template, $this->smarty->cache_id); } else { $this->content = $this->smarty->fetch($this->template); } // render the envelope too if requested if (!is_null($this->envelope)) { $envelope = new ResponseSmarty($this->envelope, null); $envelope->clearHeaders(); // assign child variables foreach ($this->getTemplateVars() as $k => $v) { $envelope->assign($k, $v); } // copy headers foreach ($this->getAllHeaders() as $headerType => $header) { $envelope->setHeader($headerType, $header); } foreach ($this->getAllHttpHeaders() as $headerCode => $header) { $envelope->setHttpHeader($headerCode); } // assigned rendered template $envelope->assign($this->envelopeVariable, $this->content); return $envelope->smarty->fetch($this->envelope); } return $this->content; }