我用:
$response = new\Symfony\Component\HttpFoundation\RedirectResponse('/new_page');
$response->send();但在这里,我没有重定向的选择,例如在5s之后。
P.S. header( "refresh:5;url=/new_page" );不是一个好主意,我正在寻找一个Drupal 8选项。谢谢。:)
发布于 2017-10-18 11:03:39
这应该通过JavaScript的setTimeout()函数在前端完成。
示例
setTimeout(
function() {
window.location = "http://www.yoururl.com";
}, 5000
);https://stackoverflow.com/questions/46805309
复制相似问题