website/src/Controller/DefaultController.php

23 lines
675 B
PHP
Raw Normal View History

2021-08-05 13:51:44 +02:00
<?php
namespace JeroenED\Website\Controller;
use JeroenED\Framework\Controller;
use JeroenED\Framework\Repository;
use JeroenED\Website\Repository\Page;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
class DefaultController extends Controller
{
public function DefaultAction($page)
{
$pageRepo = new Page();
$page = $pageRepo->getPage($page);
2021-08-05 14:46:20 +02:00
return $this->render('/page.html.twig', [
'header' => $page['header'],
'content' => $page['content'],
'title' => $page['title']], $page['status']);
2021-08-05 13:51:44 +02:00
}
}