| @@ 79-92 (lines=14) @@ | ||
| 76 | * @return array |
|
| 77 | */ |
|
| 78 | ||
| 79 | public function showComments() |
|
| 80 | { |
|
| 81 | //$this->start(); |
|
| 82 | $comment = new Comment(); |
|
| 83 | $comment->setDb($this->di->get("db")); |
|
| 84 | $this->di->get("view")->add("comment/comment", [ |
|
| 85 | "comments" => $comment->findAll() |
|
| 86 | ]); |
|
| 87 | ||
| 88 | // Render a standard page using layout |
|
| 89 | $this->di->get("pageRender")->renderPage([ |
|
| 90 | "title" => "Comment", |
|
| 91 | ]); |
|
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| 95 | * Edit a post |
|
| @@ 102-114 (lines=13) @@ | ||
| 99 | * @return void |
|
| 100 | */ |
|
| 101 | ||
| 102 | public function showEdit($postId) |
|
| 103 | { |
|
| 104 | $comment = new Comment(); |
|
| 105 | $comment->setDb($this->di->get("db")); |
|
| 106 | $this->di->get("view")->add("comment/edit", [ |
|
| 107 | "values" => $comment->find("id", $postId) |
|
| 108 | ]); |
|
| 109 | ||
| 110 | // Render a standard page using layout |
|
| 111 | $this->di->get("pageRender")->renderPage([ |
|
| 112 | "title" => "Edit", |
|
| 113 | ]); |
|
| 114 | } |
|
| 115 | ||
| 116 | /** |
|
| 117 | * Save the edited post |
|