{% for progress in progressItems %}
[*]
{{ progress.title }}
{{ progress.description }}
{% if progress.image %}
{% else %}
Изображение не доступно
{% endif %}
{% endfor %}
< /code>
/**
* @Route("/", name="progress_list")
*/
public function progressList(EntityManagerInterface $entityManager): Response
{
$progressRepository = $entityManager->getRepository(Progress::class);
$progressItems = $progressRepository->findAll();
return $this->render('index.html.twig', [
'progressItems' => $progressItems,
]);
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... ms-does-no
Полная версия