【问题标题】:conversion array to string php将数组转换为字符串 php
【发布时间】:2021-12-27 14:35:13
【问题描述】:
 public function showall(ClubRepository $rep): Response

 {

$listClubs = $rep->findAll();

return $this ->render('club/listClubs.html.twig',[

'clubs'->$listClubs,

 ]);

 }

问题就在这里:'clubs'->$listClubs

【问题讨论】:

标签: php arrays type-conversion


【解决方案1】:

我认为你使用 Symfony 框架。

如果您想将参数添加到 Twig 文件,您需要:

return $this->render('club/listClubs.html.twig',[
   'clubs' => $listClubs,
]);

使用=> 而不是->

问候,

【讨论】:

    猜你喜欢
    • 2018-01-29
    • 2013-08-12
    • 1970-01-01
    • 2010-10-15
    • 1970-01-01
    • 2013-05-12
    • 2013-04-27
    • 2016-04-28
    相关资源
    最近更新 更多