website/app/start.php

32 lines
723 B
PHP
Raw Normal View History

2015-08-30 12:34:43 -04:00
<?php
use DI\Container;
use Slim\Factory\AppFactory;
2015-08-30 12:34:43 -04:00
use Slim\Views\Twig;
use Slim\Views\TwigMiddleware;
2015-08-30 12:34:43 -04:00
require __DIR__ . '/../vendor/autoload.php';
2015-08-30 12:34:43 -04:00
// 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();
2015-08-30 12:34:43 -04:00
// Create Twig
$twig = Twig::create(__DIR__ . '/../views', ['cache' => false]);
// Add Twig-View Middleware
$app->add(TwigMiddleware::create($app, $twig));
2015-08-30 12:34:43 -04:00
// Database configs
//require 'database.php';
2015-08-30 12:34:43 -04:00
// Routes configs
require 'routes.php';