[SOLVED] Get parameters from before login

I open ie: index.php?r=site/record&id=2, yii redirects me to site/login.

How can I obtain given id parameter?

Best idea I can get is to parse Yii::app()->user->returnUrl string, but maybe there's smarter way.


so I need to parse the returnUrl then

You could also extend CWebUser to remember the GET variables in a session or something. Perhaps for your case, if the user needs to logon it should not redirect him at all, but instead show the logon form as a widget on the same page without a redirection.

could anybody tell me how to display another controller's view inside another controller?

From http://www.yiiframew…#render-detail:


$view  string  name of the view to be rendered. See getViewFile for details about how the view script is resolved.

From http://www.yiiframew…iewFile-detail:


Looks for the view file according to the given view name. This method will look for the view under the controller's viewPath. If the view name starts with '/', the view will be looked for under the application's viewPath.



$this->render('/ControllerID/ViewID', array(...));

// Or:

$this->renderPartial('/ControllerID/ViewID', array(...));