CopyPastor

Detecting plagiarism made easy.

Score: 0.9784159822655576; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2024-09-03
by Saparmyrat

Original Post

Original - Posted on 2015-02-17
by deacs



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You could use `Yii::$app->request->referrer` which returns the last page the user was on.
Usage is straightforward:
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);
You could use `Yii::$app->request->referrer` which returns the last page the user was on.
Usage is straightforward:
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);
See [the docs][1].

[1]: http://www.yiiframework.com/doc-2.0/yii-web-request.html#$referrer-detail

        
Present in both answers; Present only in the new answer; Present only in the old answer;