- Quick method to render an error view
This commit is contained in:
parent
83d52e87ae
commit
5c06419f15
|
@ -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
|
public function renderDocumentation(string $filename) : ResponseInterface
|
||||||
{
|
{
|
||||||
return $this->renderMarkdown( file_get_contents(getenv("PROJECT_PATH") . "/meta/doc/$filename.md") );
|
return $this->renderMarkdown( file_get_contents(getenv("PROJECT_PATH") . "/meta/doc/$filename.md") );
|
||||||
|
|
Loading…
Reference in New Issue