Exemplo n.º 1
0
 /**
  * Renders the view.
  *
  * @param string $view   View to render.
  * @param array  $locals Variables for the view.
  *
  * @return string
  */
 public function renderView($view, array $locals = [])
 {
     $content = View::render($view, $locals);
     if (isset($locals['_layout']) && $locals['_layout']) {
         $content = $this->renderView("layouts/{$locals['_layout']}", ['content' => $content]);
     }
     return $content;
 }
Exemplo n.º 2
0
 /**
  * Configures the view rendering system.
  */
 protected function configureTemplating()
 {
     View::setEngine(new PhpEngine());
     View::addPath("{$this->path}/views");
 }