无法转发到不同bunde symfony的路由方法控制器

无法转发到不同bunde symfony的路由方法控制器,symfony,routes,Symfony,Routes,获得了我的包的以下结构: Presentation->Api->Rest->Controller->CoachController->getCoaches 我正在尝试从另一个包转发到它,但我不断得到以下错误: {"error":{"code":500,"message":"Internal Server Error","exception":[{"message":"Class \"Presentation\\Api\\Rest\\Controller:Coach

获得了我的包的以下结构:

Presentation->Api->Rest->Controller->CoachController->getCoaches
我正在尝试从另一个包转发到它,但我不断得到以下错误:

{"error":{"code":500,"message":"Internal Server Error","exception":[{"message":"Class \"Presentation\\Api\\Rest\\Controller:Coach\" does not exist.","class":"InvalidArgumentException",
我试过的是:

return $this->forward('Presentation\Api\Rest\Controller:Coach::getCoaches');

你知道这为什么不起作用吗?

你的名称空间可能有输入错误,这里有一个文档链接:
尝试更新代码:
return$this->forward('Presentation\Api\Rest\Controller\CoachController::getcoach');
顺便说一下,您的
getcoach
函数应该如下所示:

namespace Presentation\Api\Rest\Controller;
...
class CoachController {
...
    public function getCoaches()
    {
        // ... create and return a Response object
    }
}

检查名称空间、类名和方法名是否正确,并尝试使用双反斜杠。例如Presentation\\Api\\Rest\\Controller:Coach::GetCoacheSy您的格式有点不正确。谢谢您。我找到了解决方案,我将在明天发布(从笔记本电脑到明天)