diff --git a/skeleton/novaconium/App/controllers/page.php b/skeleton/novaconium/App/controllers/page.php new file mode 100644 index 0000000..70a40b7 --- /dev/null +++ b/skeleton/novaconium/App/controllers/page.php @@ -0,0 +1,33 @@ +parameters['slug']; +$query=<<debugGetRow($query); +$data = $db->getRow($query); +if(!$data) { + http_response_code('404'); + header("Content-Type: text/html"); + view('404'); + exit; +} + +$data = array_merge($data, [ + 'menuActive' => 'blog', + 'pageid' => 'page', + 'permissionsGroup' => $session->get('group') +]); + +view('page', $data); diff --git a/skeleton/novaconium/App/routes.php b/skeleton/novaconium/App/routes.php index f36706f..8ee8ff8 100644 --- a/skeleton/novaconium/App/routes.php +++ b/skeleton/novaconium/App/routes.php @@ -8,5 +8,8 @@ $routes = [ ], '/humans.txt' => [ 'get' => 'humans' + ], + '/page/{slug}' => [ + 'get' => 'page' ] ]; \ No newline at end of file diff --git a/skeleton/novaconium/App/views/page.html.twig b/skeleton/novaconium/App/views/page.html.twig new file mode 100644 index 0000000..6c0ff09 --- /dev/null +++ b/skeleton/novaconium/App/views/page.html.twig @@ -0,0 +1,11 @@ +{% extends '@novaconium/master.html.twig' %} + +{% block content %} +

{{ title }}

+
+ {% if updated is not empty %} + Last Updated: {{ updated | date("M\\. jS Y \\a\\t g:ia") }} + {% endif %} +
+ {{ body | raw}} +{% endblock %}