I have a scenario.Page A with a login button.When I login the page gets redirected to profile page but I want to redirect to page A.
Any help…
I have a scenario.Page A with a login button.When I login the page gets redirected to profile page but I want to redirect to page A.
Any help…
Hi,
If I understand correctly you just want to return to a page you came from before you ended up on a login page?
I suspect that somewhere in your controller, in login action you will have a piece of code that would look akin to this:
$this->redirect('profile/index');
Instead of that you can use
$this->redirect(Yii::app()->user->returnUrl);
To set Yii::app()->user->returnUrl up, simply set it like this before you send user from your A page:
Yii::app()->user->setReturnUrl('/AController/someaction');
[size="1"]Disc: All controler and action names are not representative of their real names[/size]
Now you are talking about a particular controller and an action.
What to do if I have 2 controllers i.e
Two different pages A and B ,and after login I need to redirect to those previous pages.
Moreover
do I need to comment the $returnurl variable in UserModule.php??