<?php
namespace App\Controller;
use App\Entity\Content;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class ContentController extends AbstractController {
/**
* @Route("/content/{id}/{title}", name="content_page")
*/
public function getContent($id, $title)
{
$repo = $this->getDoctrine()->getRepository(Content::class)->findOneBy(['id' => $id]);
return $this->render('frontend/content.html.twig',
[
'content' => $repo,
'page' => $title
]);
}
}