Level 16
After posting a form you would return a redirect (to an URL or a route). This Url or route would then return a view.
In your code it should be 2 different methods.
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a form that updates user information and not sure what I should use to display the end point, should it be a "return view" or "return redirect". Which is better.
If you just return a view, refreshing the page will post the data again. Always redirect after handling a post.
Please or to participate in this conversation.