@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $container->set('themesdir', __DIR__ . '/../public/themes/'); |
| 40 | 40 | |
| 41 | 41 | // Set settings array in container for use in all routes |
| 42 | -$container->set('settings', function () { |
|
| 42 | +$container->set('settings', function() { |
|
| 43 | 43 | $config = file_get_contents(__DIR__ . '/../config/config.json'); |
| 44 | 44 | $settings = json_decode($config, true); |
| 45 | 45 | return $settings; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | AppFactory::setContainer($container); |
| 105 | 105 | |
| 106 | 106 | // Set Twig engine for templating |
| 107 | -$container->set('view', function () { |
|
| 107 | +$container->set('view', function() { |
|
| 108 | 108 | $settings = json_decode(file_get_contents(__DIR__ . '/../config/config.json'), true); |
| 109 | 109 | $tpls = [ |
| 110 | 110 | __DIR__ . "/../resources/views/", |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | }); |
| 133 | 133 | |
| 134 | 134 | //Set Session engine |
| 135 | -$container->set('session', function () { |
|
| 135 | +$container->set('session', function() { |
|
| 136 | 136 | return new \SlimSession\Helper(); |
| 137 | 137 | }); |
| 138 | 138 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | // Admin routes |
| 187 | 187 | $app->get('/login', HomeController::class . ":login")->setName('login'); |
| 188 | 188 | $app->post('/login', HomeController::class . ":loginPost")->setName('login-post'); |
| 189 | -$app->group('/admin', function (RouteCollectorProxy $group) { |
|
| 189 | +$app->group('/admin', function(RouteCollectorProxy $group) { |
|
| 190 | 190 | $group->get('', AdminController::class . ":adminIndex")->setName('admin'); |
| 191 | 191 | |
| 192 | 192 | $group->get('/settings', AdminController::class . ":adminSettings")->setName('admin-settings'); |
@@ -211,12 +211,12 @@ discard block |
||
| 211 | 211 | }); |
| 212 | 212 | |
| 213 | 213 | // generate routes from static pages |
| 214 | -$app->group('/pages/', function (RouteCollectorProxy $group) { |
|
| 214 | +$app->group('/pages/', function(RouteCollectorProxy $group) { |
|
| 215 | 215 | $pagesDir = $this->get('pagesdir'); |
| 216 | 216 | $pages = preg_grep('~\.(html)$~', scandir($pagesDir)); |
| 217 | 217 | foreach ($pages as $page) { |
| 218 | 218 | $route = substr($page, 0, strrpos($page, ".")); |
| 219 | - $group->get('' . $route, function ($request, $response) { |
|
| 219 | + $group->get('' . $route, function($request, $response) { |
|
| 220 | 220 | $settings = $this->get('settings'); |
| 221 | 221 | $uri = $request->getUri(); |
| 222 | 222 | $route = substr(strrchr($uri, "/"), 1); |