Home > Backend Development > PHP Tutorial > drupal8怎么redirect到另一个页面上?

drupal8怎么redirect到另一个页面上?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:29:21
Original
1336 people have browsed it

例如我想跳到地址/projects?field_name=xxx,使用D8的API应该怎么写?
D7用drupal_goto就可以了,但drupal8需要知道route name,我又不知道VIEWS的route name是什么。

回复内容:

例如我想跳到地址/projects?field_name=xxx,使用D8的API应该怎么写?
D7用drupal_goto就可以了,但drupal8需要知道route name,我又不知道VIEWS的route name是什么。

找到答案了

use Symfony\Component\HttpFoundation\RedirectResponse;

$response = new RedirectResponse('user/login');
$response->send();
Copy after login
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template