public function Render(Response $response, array $data) { $response->AddHeader('Content-type', 'text/plain'); $response->Body .= "*** The page's data set: ***\n\n"; $response->Body .= $this->renderData($data); $response->Body .= "\n****************************\n"; $response->Send(); }
public function Render(Response $response, array $data) { if (strlen($this->layout)) { $data['pageTemplate'] = $this->template; $template = $this->layout; } else { $template = $this->template; } $output = $this->twig->render($template, $data); $response->Body = $output; $response->Send(); }
public function Render(Response $response, array $data) { $jsonString = $this->jsonEncode($data); if ($this->callback) { $response->AddHeader('Content-type', 'text/javascript;charset=utf-8'); $response->Body = $this->callback . '(' . $jsonString . ');'; } else { $response->AddHeader('Content-type', 'application/json;charset=utf-8'); $response->Body = $jsonString; } $response->Send(); }
public function Render(Response $response, array $data) { $this->smarty->assign($data); if (strlen($this->layout)) { $this->smarty->assign('templateFile', $this->templatePath . $this->template); $template = $this->templatePath . $this->layout; } else { $template = $this->templatePath . $this->template; } $output = $this->smarty->fetch($template); $response->Body = $output; $response->Send(); }