Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

yii2 redirect back

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 by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #redirect
ADD COMMENT
Topic
Name
5+2 =