Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Symfony &引用;参数"&引用;路线「&引用;“必须匹配”;[^/]和#x2B+&引用;(“给定”)以生成相应的URL;_Symfony - Fatal编程技术网

Symfony &引用;参数"&引用;路线「&引用;“必须匹配”;[^/]和#x2B+&引用;(“给定”)以生成相应的URL;

Symfony &引用;参数"&引用;路线「&引用;“必须匹配”;[^/]和#x2B+&引用;(“给定”)以生成相应的URL;,symfony,Symfony,我需要你的帮助 当我发送电子邮件时,会显示此错误消息: 在呈现模板期间引发了异常(“为路由“front_Success”通知的参数”必须匹配[^/]+”(“指定以生成相应的URL”)。(500内部服务器错误) 这是我的控制器: `公共功能环境($id,请求$Request){ 专注于这一部分// $transport = \Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, ' ssl')

我需要你的帮助 当我发送电子邮件时,会显示此错误消息: 在呈现模板期间引发了异常(“为路由“front_Success”通知的参数”必须匹配[^/]+”(“指定以生成相应的URL”)。(500内部服务器错误)

这是我的控制器: `公共功能环境($id,请求$Request){

专注于这一部分//

$transport = \Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, ' ssl')
                                                ->setUsername('a.b@gmail.com')->setPassword('abcd');
`

`

这是我的树枝:

 {%if evlt.civilite=='Mme' %}Chère {%else%}Cher {%endif%}Professeur «{{evlt.nom}}»
我们将于2018年7月和08日在突尼斯哈马梅特举行的第16次国际学术讨论会上向您提供信息。我们将在第16次学术讨论会上向科学委员会和学术界提供信息,我们将为您提供帮助{{soumission.titrePapier}»avant le 15 février 2018和le lien suivant附近的客户:
{url('front_success',{'id':soumission.id,'notifId':notifId.id}}}//这里的问题
把你的思想简单化,把你的朊病毒用在你的生活中:
{{url('front_investment',{'soumission':soumission.id}}}
在讨论会上发言的议员们,请大家记住,{%if evlt.civilite='Mme'}chre{%else%}Cher{%endif%}讨论会,请大家合作。
别客气。
ATM评估委员会成员

这是路线

front_Succes:
path: /soumission_succes/{id}/{notifId}
defaults: {_controller: tutoFrontofficeBundle:Soumission:affiche }
这是函数affiche:

public function afficheAction(\tuto\BackofficeBundle\Entity\Soumission $id, \tuto\BackofficeBundle\Entity\Notification $notifId) {
    $em = $this->getDoctrine()->getManager();
    $notification = $em->getRepository('tutoBackofficeBundle:Notification')->findBy(array('soumission' => $id, 'user' => $this->getUser()));
    $notif = $em->find("tutoBackofficeBundle:Notification", $notifId);

    $notif->setLu(true);
    $em->persist($notif);
    $em->flush();
    return $this->render('tutoFrontofficeBundle:Soumission:affiche.html.twig', array('notification' => $notification));
}

我认为这只是代码中的一个输入错误。您使用的是“(”而不是notifId参数

front_Succes:
path: /soumission_succes/{id}/{notifId}
defaults: {_controller: tutoFrontofficeBundle:Soumission:affiche }
public function afficheAction(\tuto\BackofficeBundle\Entity\Soumission $id, \tuto\BackofficeBundle\Entity\Notification $notifId) {
    $em = $this->getDoctrine()->getManager();
    $notification = $em->getRepository('tutoBackofficeBundle:Notification')->findBy(array('soumission' => $id, 'user' => $this->getUser()));
    $notif = $em->find("tutoBackofficeBundle:Notification", $notifId);

    $notif->setLu(true);
    $em->persist($notif);
    $em->flush();
    return $this->render('tutoFrontofficeBundle:Soumission:affiche.html.twig', array('notification' => $notification));
}