src/Comment/HTMLForm/DeleteForm.php 1 location
|
@@ 71-79 (lines=9) @@
|
68 |
|
* |
69 |
|
* @return boolean true if okey, false if something went wrong. |
70 |
|
*/ |
71 |
|
public function callbackSubmit() |
72 |
|
{ |
73 |
|
$comment = new Comment(); |
74 |
|
$comment->setDb($this->di->get("database")); |
75 |
|
$comment->find("id", $this->form->value("select")); |
76 |
|
$comment->delete(); |
77 |
|
|
78 |
|
$this->di->get("response")->redirect("comment"); |
79 |
|
} |
80 |
|
} |
81 |
|
|
src/Comment/HTMLForm/UpdateForm.php 1 location
|
@@ 89-97 (lines=9) @@
|
86 |
|
* |
87 |
|
* @return boolean true if okey, false if something went wrong. |
88 |
|
*/ |
89 |
|
public function callbackSubmit() |
90 |
|
{ |
91 |
|
$comment = new Comment(); |
92 |
|
$comment->setDb($this->di->get("database")); |
93 |
|
$comment->find("id", $this->form->value("id")); |
94 |
|
$comment->text = $this->form->value("text"); |
95 |
|
$comment->save(); |
96 |
|
$this->di->get("response")->redirect("comment"); |
97 |
|
} |
98 |
|
} |
99 |
|
|