浏览代码

Add feeds 2

Visman 5 年之前
父节点
当前提交
979e98819d
共有 2 个文件被更改,包括 11 次插入1 次删除
  1. 10 1
      app/Models/Pages/Feed.php
  2. 1 0
      app/templates/layouts/plain.forkbb.php

+ 10 - 1
app/Models/Pages/Feed.php

@@ -10,8 +10,17 @@ use function \ForkBB\__;
 
 class Feed extends Page
 {
-    protected function exit(string $message): Page
+    protected function exit(string $message, int $status = 404): Page
     {
+        $this->plainText    = __($message);
+        $this->nameTpl      = 'layouts/plain';
+        $this->httpStatus   = \max(200, $status);
+        $this->onlinePos    = 'feed';
+        $this->onlineDetail = false;
+        $this->onlineFilter = false;
+
+        $this->header('Content-type', 'text/plain; charset=utf-8');
+
         return $this;
     }
 

+ 1 - 0
app/templates/layouts/plain.forkbb.php

@@ -0,0 +1 @@
+{{ $p->plainText }}