<?php
namespace App\Controller\Front;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use App\Repository\PageRepository;
use App\Entity\Page;
class PageController extends AbstractController
{
/**
* @Route("/page/{name}", name="front_page")
*/
public function page(Page $page, PageRepository $pageRepository)
{
return $this->render('front/page/page.html.twig', [
'page' => $pageRepository->findOneBy(['name' => $page->getName()])
]);
}
}