Implement the 'edit existing post' feature:
- add a new rule to the routes
- remember the current user id in a session variable
- only a post's author should have the right to edit it
- add a small
<form>
with a hidden 'id' field. - create the
controllers\posts\update.php
controller - in
controllers\posts\create.php
, create a new, emptyPost
and pass it to the view - rename
views\posts\create.php
toedit.php
. Insert some hidden fields. - fill all fields' values with the post's data
- modify the code in
controllers\posts\save.php
to save new and existing entries