<?php
// src/Controller/ArticlesController.php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class ArticlesController extends AbstractController
{
/**
* @Route("/", name="app_start")
* @Route("/nyheter", name="app_articles")
*/
public function articles()
{
$articles = $this->getDoctrine()->getManager()->getRepository('App\Entity\Article')->findBy([], [
'published' => 'DESC'
]);
return $this->render('articles.html.twig', [
'articles' => $articles
]);
}
}