Symfony - 参数语法和重定向

Symfony - parameters syntax and redirect

我在 Symfony 项目的 parameters.yml 中定义了我的自定义路由。

当我重定向时,我的函数发送带有用户 {hash} 的路由,但抛出错误。

The parameter "front_url2e6f62b5822e1b383ab409219f905d06" must be defined.

随机数代表我的用户哈希。

我的parameters.yml

parameters:
    front_url: 'https://my.custom-route.net/email/confirm/{hash}'

我是否需要在参数中以不同的方式定义我的 {hash} 路由部分,或者问题可能出在其他地方?

也许问题出在我的重定向上?

/**
 * @Route("/email/confirm/{hash}", name="email_confirm")
 */
public function confirmationEmailAction($hash)
{
    return $this->redirect($this->container->getParameter('front_url' . '/' . $hash));

}

I defined my custom route in parameters.yml in my Symfony project.

// routes.yaml    
custom_routes:
    resource: 'custom_routes.yaml'
    prefix:   /

// custom_routes.yaml
front_url:
    path: '%front_url%'
    defaults:
        _controller: App\Controller\HashController:hash
        hash: false

parameters:
    front_url: 'https://my.custom-route.net/email/confirm/{hash}'