Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fd9a71c4d6 |
33
skeleton/novaconium/App/controllers/page.php
Normal file
33
skeleton/novaconium/App/controllers/page.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
$slug = $router->parameters['slug'];
|
||||
$query=<<<EOSQL
|
||||
SELECT
|
||||
id,
|
||||
title,
|
||||
heading,
|
||||
description,
|
||||
keywords,
|
||||
author,
|
||||
body,
|
||||
created,
|
||||
updated
|
||||
FROM pages
|
||||
WHERE slug = '$slug'
|
||||
EOSQL;
|
||||
|
||||
//$db->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);
|
||||
@ -8,5 +8,8 @@ $routes = [
|
||||
],
|
||||
'/humans.txt' => [
|
||||
'get' => 'humans'
|
||||
],
|
||||
'/page/{slug}' => [
|
||||
'get' => 'page'
|
||||
]
|
||||
];
|
||||
11
skeleton/novaconium/App/views/page.html.twig
Normal file
11
skeleton/novaconium/App/views/page.html.twig
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends '@novaconium/master.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ title }}</h1>
|
||||
<div class="page-meta">
|
||||
{% if updated is not empty %}
|
||||
<span class="page-updated">Last Updated: {{ updated | date("M\\. jS Y \\a\\t g:ia") }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ body | raw}}
|
||||
{% endblock %}
|
||||
Loading…
x
Reference in New Issue
Block a user