登录后 返回登录前的页面 通过 url中 destination来实现
可是 当登录前的页面是 首页时 destination的值为空
可以通过 destination=<front> 来实现
Note that ?destination=<front> is 一个完全有效 and working parameter (destination goes through url()).
下面就是例子
<a href="<?php print $base_url;?>/user/login?destination=<?php $str = substr(request_uri(),1);empty($str) && $str='<front>';print $str;?>">登录</a>
Note that ?destination=<front> is 一个完全有效 and working parameter (destination goes through url()).