public function render(SiteController $controller) { $response = $controller->view()->response(); $response->status = 404; $buffer = $controller->view()->buffer(); $buffer->start(); $path = $controller->getSiteFolder() . DIRECTORY_SEPARATOR . $controller->getSiteName() . DIRECTORY_SEPARATOR . $this->page; $found = $this->engine()->render($controller->view(), $path, ['exception' => $this]); $return = $buffer->end(); if (!$found) { $response->send('Page not found'); } else { $response->send($return); } return $response; }
/** * Render * @param \BX\MVC\SiteController $controller * @return type */ public function render(SiteController $controller) { return $controller->view()->response(); }