How To Redirect After Login To A Pre-Clicked Link

i am working on application which includes sending mails, containing links.when user click on that link it checks if user is login or not, if not login then redirect to login action , otherwise redirect to particular link action.

i want flow as, when user login it should be redirect to that particular action instead of homepage of user.Please tell me solution to this problem,

Use




Yii::app()->request->redirect(Yii::app()->user->returnUrl);



once login is successful. The functionality that you’re looking for is already provided by the framework.

More info here.

It’s worth reading through that whole guide page.

@Keith

thanks for your quick reply.

it will be easier to me if you can explain it with an example, like where to set and use this url.