website/app/start.php

32 lines
723 B
PHP
Executable File

<?php
use DI\Container;
use Slim\Factory\AppFactory;
use Slim\Views\Twig;
use Slim\Views\TwigMiddleware;
require __DIR__ . '/../vendor/autoload.php';
// Let's get this session started
session_cache_limiter(false);
session_start();
// For now, display some errors
ini_set('display_errors', 'On');
// Create new container object
$container = new Container();
// Set container to create App with on AppFactory
AppFactory::setContainer($container);
$app = AppFactory::create();
// Create Twig
$twig = Twig::create(__DIR__ . '/../views', ['cache' => false]);
// Add Twig-View Middleware
$app->add(TwigMiddleware::create($app, $twig));
// Database configs
//require 'database.php';
// Routes configs
require 'routes.php';