I should not return a view from a POST request, but how to make it display the data on the same page?
I am POSTing some data from /some_url to a route, and from there to the Controller to calculate the data.
The Controller needs to return the calculated data (Currently saved in compact($var, $vars)).
What is the proper way to return this data to the same /some_url without using JS?
@MichalOravec I tried to use return redirect(some_url), but because the initial submit was a POST, it goes to an infinite loop? (It tries to resubmit the form again and it redirects to himself)
@Ligonsker Ok. Well if it isnt used for anything, you grab some identifier (an ID perhaps) and pass it to a get route (or store it in session). Then in that get route you add the calculations, and return a view.
@Sinnbeck thank you! that's exactly what's happening right now (It keeps fetching that data on F5 after the first submit even though I want it only on button click)