我正在做一个 cakephp 项目。我被困在这里。我想在 cakephp 3.2 中获取以前的 url,但它不起作用。此处的链接存在于电子邮件中,单击该链接后,我将重定向到登录页面,登录后,我想重定向到之前的 url 意味着该 url 仅存在于邮件中。我写了下面的代码来做到这一点。
$rU = $this->request->referer();
if (!stristr($rU, "users/login") && !stristr($rU, "login") && !stristr($rU, "users/register") && !stristr($rU, "register") && !stristr($rU, "appadmins") && !stristr($rU, "js") && !stristr($rU, "css") && !stristr($rU, "ajax")) {
$this->request->session()->write('visited_page',$rU);
}
请给我建议。任何建议将不胜感激。谢谢你。