Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
 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();
 }