From 3984e8339690f15f2a90bf7fe3fd7f1edf76addb Mon Sep 17 00:00:00 2001 From: "DESKTOP-4RNDQIC\\29019" <290198252@qq.com> Date: Thu, 7 May 2020 13:52:37 +0800 Subject: [PATCH] no message --- App/Controllers/Blog.php | 27 +++--- App/Views/blog/basic.html | 135 ++------------------------ App/Views/blog/template/article.html | 136 +++++++++++++++++++++++++-- 3 files changed, 150 insertions(+), 148 deletions(-) diff --git a/App/Controllers/Blog.php b/App/Controllers/Blog.php index 1e0e3ab..013a69a 100644 --- a/App/Controllers/Blog.php +++ b/App/Controllers/Blog.php @@ -28,9 +28,9 @@ class Blog extends Controller array_push($firstpagedocs,$obj); } if(\App\Config::$DEBUG) - View::renderTemplate("/blog/basic.html",['docs'=>$firstpagedocs,'index'=>true,'debug'=>true,"typedocs" => $typedocs]); + View::renderTemplate("/blog/basic.html",['type'=>'artile','docs'=>$firstpagedocs,'index'=>true,'debug'=>true,"typedocs" => $typedocs]); else{ - View::renderTemplate("/blog/basic.html",['docs'=>$firstpagedocs,'index'=>true,'debug'=>false,"typedocs" => $typedocs]); + View::renderTemplate("/blog/basic.html",['type'=>'artile','docs'=>$firstpagedocs,'index'=>true,'debug'=>false,"typedocs" => $typedocs]); } } function articleAction() { @@ -47,19 +47,22 @@ class Blog extends Controller echo ''; if(\App\Config::$DEBUG) View::renderTemplate("/blog/basic.html", - ['title'=>rawurldecode($this->querys['title']), - 'index'=>false, - 'content'=>$content, - 'type' => $this->querys['type'], - 'debug' => true, - 'article'=>true, - "typedocs" => $typedocs, - "comments" => $doccoment, - "comment_count" => count($doccoment), - "docid"=>$id, + [ + 'type'=>'artile', + 'title'=>rawurldecode($this->querys['title']), + 'index'=>false, + 'content'=>$content, + 'type' => $this->querys['type'], + 'debug' => true, + 'article'=>true, + "typedocs" => $typedocs, + "comments" => $doccoment, + "comment_count" => count($doccoment), + "docid"=>$id, ]); else View::renderTemplate("/blog/basic.html",[ + 'type'=>'artile', 'title'=>rawurldecode($this->querys['title']), 'article'=>true, 'content'=>$content, diff --git a/App/Views/blog/basic.html b/App/Views/blog/basic.html index 6a41db7..05e2d0f 100644 --- a/App/Views/blog/basic.html +++ b/App/Views/blog/basic.html @@ -151,6 +151,7 @@ ul li a{ +
-
-
- - -
- - - - - -
+{% if type == article %} +{% use '/blog/template/article.html' %} +{% endif %} +{% if type == "funding" %} +{% include '/blog/template/article.html' %} +{% endif %} - diff --git a/App/Views/blog/template/article.html b/App/Views/blog/template/article.html index 77ef803..7a905c1 100644 --- a/App/Views/blog/template/article.html +++ b/App/Views/blog/template/article.html @@ -1,10 +1,128 @@ - - - - Title - - +
+
+ + +
+ + + + + + +
\ No newline at end of file