Create conditions if no id is given.
This commit is contained in:
parent
a2a5289f66
commit
e7b5eec29d
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user