diff --git a/App/Controllers/Posts.php b/App/Controllers/Posts.php index 5cd0516..3823c8f 100644 --- a/App/Controllers/Posts.php +++ b/App/Controllers/Posts.php @@ -19,10 +19,13 @@ class Posts return true; } - public function edit($id) + public function edit($id = null) { - echo "You can edit exists data with id $id here"; // Nanti di replace sama twig view ke App\Views\Data\edit_pengumuman.html - View::render('Data/edit_pengumuman.html'); - return true; + if ($id) { + echo "You can edit exists data with id $id here"; // Nanti di replace sama twig view ke App\Views\Data\edit_pengumuman.html + View::render('Data/edit_pengumuman.html'); + return true; + } + return false; } }