public function showall(ClubRepository $rep): Response
{
$listClubs = $rep->findAll();
return $this->render('club/listClubs.html.twig',[
'clubs'->$listClubs,
]);
}
问题就在这里:
'clubs'->$listClubs
我认为你使用 Symfony 框架。
如果你想向 Twig 文件添加参数,你需要:
return $this->render('club/listClubs.html.twig',[
'clubs' => $listClubs,
]);
使用
=>
代替 ->
问候,