我有以下代碼的問題:控制器$langage = $request->request->get('langage-choisis');$baturl = "href=\"http://localhost:8000/?keyview=".$keypreview."&order=".$numerocommande."&watch=yes"."\"";$message = (new \Swift_Message($subject)) ->setFrom('devdalvin@gmail.com') ->setTo( $destinataires) ->setBody( $this->renderView('emails/contact.html.twig', [ 'IdOrder' => $langage, 'messagegraphist' => $messagegraphist, 'messageinvoice' => $messageinvoice, 'baturl'=> $baturl, 'mailinstructions' => $mailinstructions, 'ordrefabrication' => $ordrefabrication, 'langage' => $langage, ]), 'text/html' );$mailer->send($message);樹枝模板{% block email %} <p>Bonjour, <br/> Nos équipes ont terminées la préparation du BAT pour votre commande n°{{ IdOrder }}. <br>Si votre commande comporte plusieurs articles, vous recevrez un BAT par article. <br>Nous soulignons que nos dates de production et d'expédition courent à date de validation du présent BAT.<br> {% if messagegraphiste is defined %} <p><b>Précision de notre service graphique : </b></p> <br>{{ messagegraphist }}<br> {% endif %} <br>{{ messageinvoice | raw}} <br> <p><a style="color: white; padding: 20px 20px; background-color: #19692c" {{ baturl | raw}} ><b>VOIR LE BAT</b></a></p> <br>{{ mailinstructions | raw}}<br> Notre équipe vous souhaite une agréable journée. </p>{{ langage }}{% endblock %}令人費解的是,我無法在沒有此錯誤的情況下添加其他變量。但是,我將 $langage 作為變量 'IdOrder' 的值,并且它有效。但是當我想在我的表中添加一個變量時:不可能。我還嘗試為 'langage' 賦予另一個值(如 $orderfabrication),但在 'orderfabrication' 起作用時它仍未定義。有人有想法嗎?謝謝 :)
1 回答

狐的傳說
TA貢獻1804條經(jīng)驗 獲得超3個贊
謝謝你的幫助。但是,我已經(jīng)考慮過清理緩存。此外,這是我的電子郵件/contact.html.twig 文件的全部內容。轉儲還用于檢查定義明確的 $ 語言的值(在 contact.html.twig 中使用 $IdOrder 檢查)。所以,我正在嘗試清潔計算機。
- 1 回答
- 0 關注
- 156 瀏覽
添加回答
舉報
0/150
提交
取消