Added some views
This commit is contained in:
parent
899dc431b8
commit
8297325cf6
@ -7,4 +7,14 @@ use Slim\Views\Twig;
|
|||||||
$app->get('/', function (Request $request, Response $response, array $args) {
|
$app->get('/', function (Request $request, Response $response, array $args) {
|
||||||
$view = Twig::fromRequest($request);
|
$view = Twig::fromRequest($request);
|
||||||
return $view->render($response, 'index.twig');
|
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
7
views/contact.twig
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{% extends 'layout.twig' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<p>This is a contact.</p>
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -1 +1,7 @@
|
|||||||
|
{% extends 'layout.twig' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
<p>This is a test.</p>
|
<p>This is a test.</p>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
8
views/layout.twig
Normal file
8
views/layout.twig
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Bit Goblin</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{% block content %}{% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
7
views/support.twig
Normal file
7
views/support.twig
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{% extends 'layout.twig' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<p>This is a support.</p>
|
||||||
|
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user