zu3i4ot
(Zu3i4ot)
August 24, 2011, 6:03am
1
i have a groups controller and user can join groups by ajax link which links to groups/addnew
the logic is simple if user is guest then the ajax link result should redirect user to the login page or render the login and after login it should return to the page that it was on or submit the ajax request but it doesn’t do any of this can anyone tell me how it can be done
joblo
(Joe)
August 24, 2011, 9:55am
2
Do something like this in your ajax-response:
if (Yii::app()->request->isAjaxRequest)
{
$redirectUrl = Yii::app()->createUrl(....);
echo CHtml::script("location.href='$redirectUrl';");
Yii::app()->end();
}
See Yii::app()->user->setReturnUrl(…) too.
lugal
(Lugal Cn)
September 15, 2011, 3:21am
3
Joblo:
Do something like this in your ajax-response:
if (Yii::app()->request->isAjaxRequest)
{
$redirectUrl = Yii::app()->createUrl(....);
echo CHtml::script("location.href='$redirectUrl';");
Yii::app()->end();
}
See Yii::app()->user->setReturnUrl(…) too.
I build the link by ajaxlink(), return the
<script type="text/javascript">
/<![CDATA[ /
location.href=‘http://www.yiiframework.com ’;
/]]> /
</script>
but didn’t redirect to www.yiiframework.com
how to fix it after the ajax requesting?
Lugal:
I build the link by ajaxlink(), return the
<script type="text/javascript">
/<![CDATA[ /
location.href=‘http://www.yiiframework.com ’;
/]]> /
</script>
but didn’t redirect to www.yiiframework.com
how to fix it after the ajax requesting?
im also have sam problem , is there any solution?