diff --git a/App/Controllers/Blog.php b/App/Controllers/Blog.php index 02f518b..a6f4c11 100644 --- a/App/Controllers/Blog.php +++ b/App/Controllers/Blog.php @@ -54,7 +54,9 @@ class Blog extends Controller 'type' => $this->querys['type'], 'debug' => true, 'article'=>true, - "typedocs" => $typedocs + "typedocs" => $typedocs, + "comments" => $doccoment, + "comment_count" => count($doccoment), ]); else View::renderTemplate("/blog/basic.html",[ @@ -62,7 +64,9 @@ class Blog extends Controller 'article'=>true, 'content'=>$content, 'type' => $this->querys['type'], - "typedocs" => $typedocs + "typedocs" => $typedocs, + "comments" => $doccoment, + "comment_count" => count($doccoment), ]); }else{ View::renderTemplate("/blog/basic.html",['title'=>'test','index'=>false]); diff --git a/App/Controllers/DocComment.php b/App/Controllers/DocComment.php index fd342f3..cbe73fb 100644 --- a/App/Controllers/DocComment.php +++ b/App/Controllers/DocComment.php @@ -23,6 +23,6 @@ class DocComment extends Controller public function getDocCommentAction(){ $comment = new Models\DocComment(); var_dump($this->input); - var_dump($comment->DocComments(1)); + var_dump($comment->DocComments(8)); } } \ No newline at end of file diff --git a/App/Views/blog/basic.html b/App/Views/blog/basic.html index ed8a09d..17915c6 100644 --- a/App/Views/blog/basic.html +++ b/App/Views/blog/basic.html @@ -227,7 +227,7 @@ ul li a{
- 1条评论 + {{comment_count}}条评论
@@ -250,7 +250,7 @@ ul li a{
  • - +
    @@ -268,62 +268,6 @@ ul li a{
    - -
      - -
    • -
      -
      - -
      -
      -
      - {$child.nickname} - {$child.create_time} -
      -
      -

      - {$child.content} -

      -
      - -
      -
      - - -
        - -
      • -
        -
        - -
        -
        -
        - {$grandson.nickname} - {$grandson.create_time} -
        -
        -

        - {$grandson.content} -

        -
        - -
        -
        -
      • -
        -
      - - -
    • -
      -
    -
  • diff --git a/App/Views/blog/res/pic/default.jpg b/App/Views/blog/res/pic/default.jpg new file mode 100644 index 0000000..7241848 Binary files /dev/null and b/App/Views/blog/res/pic/default.jpg differ