Skip to content

Instantly share code, notes, and snippets.

@tatma
Last active September 6, 2018 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatma/135b5a3b7cf3553e4777b70b5c2a6191 to your computer and use it in GitHub Desktop.
Save tatma/135b5a3b7cf3553e4777b70b5c2a6191 to your computer and use it in GitHub Desktop.
List articles
<?php
/*
* Contenuto precedente
*/
/**
* @Route("/list", name="list_articles")
*/
public function listArticles()
{
$em = $this->getDoctrine();
$articles = $em->getRepository('App:Article')->findAll();
return $this->render('list.html.twig', [
'articles' => $articles,
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment