Added some views

This commit is contained in:
Gregory Ballantine 2022-07-09 13:20:07 -04:00
parent 899dc431b8
commit 8297325cf6
5 changed files with 40 additions and 2 deletions

View File

@ -7,4 +7,14 @@ use Slim\Views\Twig;
$app->get('/', function (Request $request, Response $response, array $args) {
$view = Twig::fromRequest($request);
return $view->render($response, 'index.twig');
});
})->setName('home');
$app->get('/contact', function (Request $request, Response $response, array $args) {
$view = Twig::fromRequest($request);
return $view->render($response, 'contact.twig');
})->setName('contact');
$app->get('/support', function (Request $request, Response $response, array $args) {
$view = Twig::fromRequest($request);
return $view->render($response, 'support.twig');
})->setName('support');

7
views/contact.twig Normal file
View File

@ -0,0 +1,7 @@
{% extends 'layout.twig' %}
{% block content %}
<p>This is a contact.</p>
{% endblock %}

View File

@ -1 +1,7 @@
<p>This is a test.</p>
{% extends 'layout.twig' %}
{% block content %}
<p>This is a test.</p>
{% endblock %}

8
views/layout.twig Normal file
View File

@ -0,0 +1,8 @@
<html>
<head>
<title>Bit Goblin</title>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>

7
views/support.twig Normal file
View File

@ -0,0 +1,7 @@
{% extends 'layout.twig' %}
{% block content %}
<p>This is a support.</p>
{% endblock %}