欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

让Drupal在登录后自动跳转到登录之前的页面 上一页面 有大用

让Drupal在登录后自动跳转到登录之前的页面

在模版页内用l()加入如下登录链接:


l("登录", "user/login", array('attributes' => array('title' => t('登录唯枫志')), 'query' => drupal_get_destination()))

关键在于参数drupal_get_destination函数,drupal会自动获取访问页面所需的URI,并以destination=URI的形式输出,然后在登录后根据destination的值再跳转到该页面。另外l()函数的用法参考这里,drupal_get_destination函数的说明在这里。

————————————————

来自:https://blog.csdn.net/supxiaoqiang1/article/details/5819713



普通分类: