website/src/Controller/DefaultController.php

20 lines
611 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);
return $this->render('/page.html.twig', ['header' => $page['header'], 'content' => $page['content']], $page['status']);
}
}