Question : yii2 redirect back
Answered by : nutty-narwhal-xpaxojtg3g20
return $this->redirect(Yii::$app->request->referrer);
//You need also take into account that referrer can be null:
return $this->redirect(Yii::$app->request->referrer ?: Yii::$app->homeUrl);
Source : https://stackoverflow.com/questions/28554211/yii2-redirect-to-previous-page | Last Update : Mon, 25 Jul 22