From f7bfdf58def6aadc922e1632f407d1418269a0d7 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 9 Jul 2022 19:40:17 +0300 Subject: initial --- skin/error.skin.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 skin/error.skin.php (limited to 'skin/error.skin.php') diff --git a/skin/error.skin.php b/skin/error.skin.php new file mode 100644 index 0000000..b0925d3 --- /dev/null +++ b/skin/error.skin.php @@ -0,0 +1,40 @@ +common(403, 'Forbidden', $message); +} + +function not_found($ctx, $message) { + return $ctx->common(404, 'Not Found', $message); +} + +function unauthorized($ctx, $message) { + return $ctx->common(401, 'Unauthorized', $message); +} + +function not_implemented($ctx, $message) { + return $ctx->common(501, 'Not Implemented', $message); +} + +function common($ctx, + int $code, + string|Stringable $title, + string|Stringable|null $message = null) { +return << + $code $title + +

$code $title

+ {$ctx->if_true($message, + '

'.$message.'

' + )} + + + +HTML; + +} \ No newline at end of file -- cgit v1.2.3