【发布时间】:2017-07-12 06:53:27
【问题描述】:
默认情况下不允许重定向到外部 URL,请使用\Drupal\Core\Routing\TrustedRedirectResponse。
我在 Drupal 8 中启用我的自定义模块时收到此错误。
【问题讨论】:
标签: drupal-8
默认情况下不允许重定向到外部 URL,请使用\Drupal\Core\Routing\TrustedRedirectResponse。
我在 Drupal 8 中启用我的自定义模块时收到此错误。
【问题讨论】:
标签: drupal-8
检查你 routing.yml 和 menu.yml
您创建的路由名称应该在menu.yml 中,例如:
在routing.yml中
test_module.description:
path: 'testing/new-example'
defaults:
_controller: '\Drupal\test_module\Controller\Page::description'
_title: 'Form API Examples'
requirements:
_permission: 'access content'
在 menu.yml 中
test_module.description:
title: Form API Examples
description: Form examples using Drupal Form API.
route_name: test_module.description
【讨论】: