Create conditions if no id is given.

This commit is contained in:
Gregorio Chiko Putra 2017-09-04 14:47:30 +07:00
parent a2a5289f66
commit e7b5eec29d

View File

@ -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;
}
}