- Quick method to render an error view

This commit is contained in:
Ubuntu 2022-05-11 12:32:05 +00:00
parent 83d52e87ae
commit 5c06419f15
1 changed files with 7 additions and 0 deletions

View File

@ -61,6 +61,13 @@ trait ControllerTrait {
);
}
public function renderError(string $errorCode, ?array $variables = null) : ResponseInterface
{
return static::renderHtml(
$this->renderRawView("$lean/error/{$code}", $variables ?? [])
);
}
public function renderDocumentation(string $filename) : ResponseInterface
{
return $this->renderMarkdown( file_get_contents(getenv("PROJECT_PATH") . "/meta/doc/$filename.md") );