How can i redirect user to previous page after updating a record? this is the typical scenario:
Ive tried using below in my controller after updating
return $this->redirect('index',302); (this is not what I need)
return $this->redirect(Yii::$app->request->referrer); (this gets user back to update view and not to index view with filters)
return $this->goBack(); (this gets user to homepage)
Thanks!
In the action you want user to be redirected to add
\yii\helpers\Url::remember();
Now next call in any controller like:
return $this->goBack();
Will redirect user to the "marked" action.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With