Initial Build
This commit is contained in:
parent
71cd3acccd
commit
6c0d9a3f98
140 changed files with 9802 additions and 2403 deletions
24
src/Controller/FrontEnd/PageController.php
Normal file
24
src/Controller/FrontEnd/PageController.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller\FrontEnd;
|
||||
|
||||
use App\Entity\Page;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
final class PageController extends AbstractController
|
||||
{
|
||||
#[Route('/{url:page}', name: 'front_end_page')]
|
||||
public function index(Page $page): Response
|
||||
{
|
||||
if ($page->isPublished()) {
|
||||
return $this->render('front/page/index.html.twig', [
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
|
||||
return new Response('<h1>Page not found</h1>');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue