Enable refresh on form controller requests (correct branch)
This adds support for a redirect to the current page (a refresh) to be returned by the form controller. An example use case is adding `data-request-data="refresh:1"` to the save button on an update form. I'm using it for an update form that disables certain fields (including a relationRender partial) based on values submitted on that page. Refreshing the view after saving allows my disabling rules to take effect.
This commit is contained in:
parent
c0f14b33a7
commit
b26eeed03c
|
|
@ -389,6 +389,10 @@ class FormController extends ControllerBehavior
|
|||
if (post('close') && !ends_with($context, '-close')) {
|
||||
$context .= '-close';
|
||||
}
|
||||
|
||||
if (post('refresh', false)) {
|
||||
return Redirect::refresh();
|
||||
}
|
||||
|
||||
if (post('redirect', true)) {
|
||||
$redirectUrl = $this->getRedirectUrl($context);
|
||||
|
|
|
|||
Loading…
Reference in New Issue