Esempio n. 1
0
 /**
  * Render a template
  *
  * Call this method within a GET, POST, PUT, DELETE, NOT FOUND, or ERROR
  * callable to render a template whose output is appended to the
  * current HTTP response body. How the template is rendered is
  * delegated to the current View.
  *
  * @param   string  $template   The name of the template passed into the View::render method
  * @param   array   $data       Associative array of data made available to the View
  * @param   int     $status     The HTTP response status code to use (Optional)
  * @return  void
  */
 public function render($template, $data = array(), $status = null)
 {
     if (!is_null($status)) {
         $this->response->status($status);
     }
     $this->view->setTemplatesDirectory($this->config('templates.path'));
     $this->view->appendData($data);
     $this->view->display($template);
 }
 /**
  * Render a template
  *
  * Call this method within a GET, POST, PUT, DELETE, NOT FOUND, or ERROR
  * callable to render a template whose output is appended to the
  * current HTTP response body. How the template is rendered is
  * delegated to the current View.
  *
  * @param   string  $template   The name of the template passed into the View::render method
  * @param   array   $data       Associative array of data made available to the View
  * @param   int     $status     The HTTP response status code to use (Optional)
  * @return  void
  */
 public function render($template, $data = array(), $status = null)
 {
     $templatesPath = $this->config('templates.path');
     //Legacy support
     if (is_null($templatesPath)) {
         $templatesPath = $this->config('templates_dir');
     }
     $this->view->setTemplatesDirectory($templatesPath);
     if (!is_null($status)) {
         $this->response->status($status);
     }
     $this->view->appendData($data);
     $this->view->display($template);
 }
Esempio n. 3
0
 /**
  * Render a template
  *
  * Call this method within a GET, POST, PUT, DELETE, NOT FOUND, or ERROR
  * callable to render a template whose output is appended to the
  * current HTTP response body. How the template is rendered is
  * delegated to the current View.
  *
  * @param   string  $template   The name of the template passed into the View::render method
  * @param   array   $data       Associative array of data made available to the View
  * @param   int     $status     The HTTP response status code to use (Optional)
  * @return  void
  */
 public function render($template, $data = array(), $status = null)
 {
     if (!is_null($status)) {
         $this->response->status($status);
     }
     $this->view->appendData($data);
     $this->view->display($template);
 }