Started work on the site design
This commit is contained in:
17
app/bootstrap.php
Normal file
17
app/bootstrap.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Slim\Factory\AppFactory;
|
||||
use Slim\Views\Twig;
|
||||
use Slim\Views\TwigMiddleware;
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$app = AppFactory::create();
|
||||
|
||||
// Create Twig
|
||||
$twig = Twig::create(__DIR__ . '/../views', ['cache' => false]);
|
||||
// Add Twig-View Middleware
|
||||
$app->add(TwigMiddleware::create($app, $twig));
|
||||
|
||||
// Register routes
|
||||
require_once __DIR__ . '/routes.php';
|
10
app/routes.php
Normal file
10
app/routes.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Slim\Views\Twig;
|
||||
|
||||
$app->get('/', function (Request $request, Response $response, array $args) {
|
||||
$view = Twig::fromRequest($request);
|
||||
return $view->render($response, 'index.twig');
|
||||
});
|
Reference in New Issue
Block a user