Answer the question
In order to leave comments, you need to log in
Why can Yii::app()->request->urlReferrer be empty in yii?
Good afternoon,
I put the following construction into the controller action (users/registration):
if(!$role || ($role < 1 || $role > 2))
{
Yii::app()->user->setFlash('error','Пожалуйста укажите роль');
die(Yii::app()->request->urlReferrer);
$this->redirect(Yii::app()->request->urlReferrer);
}
Answer the question
In order to leave comments, you need to log in
The client is not obliged to give you his Referrer, this is "voluntary" information.
If you open a bookmarked page or open a new tab, there may not be a referrer.
Or the browser just "wanted".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question