示例#1
0
 /**
  * Render a template
  * @param \ResponseInterface $response
  * @param                    $template
  * @param array              $data
  * @return ResponseInterface
  */
 public function render(ResponseInterface $response, $template, array $data = [])
 {
     ob_start();
     echo $this->renderer->render($template, $data);
     $output = ob_get_clean();
     $response->getBody()->write($output);
     return $response;
 }
示例#2
0
 /**
  * render
  *
  * @return  string
  *
  * @throws \RuntimeException
  */
 public function render()
 {
     $data = $this->getData();
     $this->prepare($data);
     return $this->renderer->render($this->getLayout(), $data);
 }