PhpGt / WebEngine

Minimalistic, ergonomic PHP toolkit.
https://www.php.gt/webengine
MIT License
26 stars 6 forks source link

Surpress reload from within do function #631

Closed g105b closed 1 year ago

g105b commented 1 year ago

By default, do functions automatically reload the page after execution. This avoids the double submit problem, which is annoying if CSRF tokens are in play.

It's also possible to prevent this behaviour by adding the NoReloadDo Attribute.

However, it's sometimes useful to use the default post-redirect-get pattern, but override it within the do function. The most obvious example of this is when server side form validation fails: we would want to return the do function, but without causing the page to reload, so the validation errors are displayed correctly.

g105b commented 1 year ago

Not needed anymore since suppression is removed in #632