summaryrefslogtreecommitdiff
path: root/skin/error.skin.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2024-01-31 06:11:00 +0300
committerEvgeny Zinoviev <me@ch1p.io>2024-01-31 20:45:40 +0300
commitc0dc531ebefd8912819f3b6c8bda1fed3c7e750c (patch)
tree2c75aa9df182260aef09faf4befd81a4c2b9c5e2 /skin/error.skin.php
parent48d688cdf7f9eae1bf11b8a6f0e5b98687c604cb (diff)
make it simple, but not simpler
Diffstat (limited to 'skin/error.skin.php')
-rw-r--r--skin/error.skin.php27
1 files changed, 5 insertions, 22 deletions
diff --git a/skin/error.skin.php b/skin/error.skin.php
index 5276bfa..8f7e4c7 100644
--- a/skin/error.skin.php
+++ b/skin/error.skin.php
@@ -4,34 +4,17 @@ namespace skin\error;
use Stringable;
-function forbidden($ctx, $message) {
- return $ctx->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) {
+function http_error($ctx,
+ int $code,
+ string|Stringable $title,
+ string|Stringable|null $message = null) {
return <<<HTML
<html>
<head><title>$code $title</title></head>
<body>
<center><h1>$code $title</h1></center>
- <hr>
{$ctx->if_true($message,
- '<p align="center">'.$message.'</p>'
+ '<hr><p align="center">'.$message.'</p>'
)}
</body>
</html>