让Drupal在登录后自动跳转到登录之前的页面 水深无声 2022-07-12 15:16 159阅读 0赞 在模版页内用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函数的说明在这里。
还没有评论,来说两句吧...