1
0
This commit is contained in:
Christiaan Goossens
2017-02-09 07:50:51 +01:00
commit 9b25e5b785
11 changed files with 455 additions and 0 deletions

10
src/dependencies.php Normal file
View File

@ -0,0 +1,10 @@
<?php
// DIC configuration
$container = $app->getContainer();
// view renderer
$container['renderer'] = function ($c) {
$settings = $c->get('settings')['renderer'];
return new Slim\Views\PhpRenderer($settings['template_path']);
};

4
src/middleware.php Normal file
View File

@ -0,0 +1,4 @@
<?php
// Application middleware
// e.g: $app->add(new \Slim\Csrf\Guard);

7
src/routes.php Normal file
View File

@ -0,0 +1,7 @@
<?php
// Routes
$app->get('/[{name}]', function ($request, $response, $args) {
// Render index view
return $this->renderer->render($response, 'index.phtml', $args);
});

12
src/settings.php Normal file
View File

@ -0,0 +1,12 @@
<?php
return [
'settings' => [
'displayErrorDetails' => true, // set to false in production
'addContentLengthHeader' => false, // Allow the web server to send the content-length header
// Renderer settings
'renderer' => [
'template_path' => __DIR__ . '/../templates/',
]
],
];