I am at a blog-page with a link for edit post. When I click the link the controller (via routes) serves me a form which you can now post.
When I post this edited message I would like to be return to the (first) blog-page I was visiting.
Ps. in this example you have to be logged in.
At any (public) page you can click the ‘login’ button to log-in. After clicking the navigation-button you will be forwarded to the login page.
After the login I do something like:
$this->flash->addMessage('success', 'Welcome, you are logged in.'); return $response->withRedirect($this->router->pathFor('home'));
I would like to adjust ‘home’ also to the current page (before the sign-in page). One note to that: if a user try;s multiple times to login (if he forgets his pass) the page for redirecting has to be the same.
How can I make this kind of thing happen?