/** * 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; }
/** * Configures the view rendering system. */ protected function configureTemplating() { View::setEngine(new PhpEngine()); View::addPath("{$this->path}/views"); }