Php 名称为3的命名路由不存在

Php 名称为3的命名路由不存在,php,paypal,slim,Php,Paypal,Slim,在PayPal中成功完成交易后,为什么我无法查看页面 routes.php $this->group('/paypal-transaction', function() { $this->get('', 'PortalPaypalTransactionController:show')->setName('portal.paypal_transaction'); }); 这是我的控制器上的代码 $this->flash->addMessage('succ

在PayPal中成功完成交易后,为什么我无法查看页面

routes.php

$this->group('/paypal-transaction', function() {
     $this->get('', 'PortalPaypalTransactionController:show')->setName('portal.paypal_transaction');
});
这是我的控制器上的代码

$this->flash->addMessage('success', 'Load-up successful!');
    return $response->withRedirect($this->router->pathFor('portal/paypal-transaction'));

您试图获取
portal/paypal transaction
的路径,但您将其声明为
portal.paypal\u transaction
。因此,请调整其中一个以匹配另一个。

我已经将pathFor('portal/paypal transaction')更改为pathFor('portal.paypal transaction'),但加载时间太长,没有发生任何事情。也将
更改为
-
或反之亦然?当我将uFor更改为-时,会显示一条错误消息“名称的命名路由不存在”pathFor和setName中的字符串应该是相同的,如果是这样,并且仍然有一个空页面,请查看php错误日志