:D require INC_ROOT . '/vendor/autoload.php'; // Time to create our app $app = new Slim([ 'mode' => file_get_contents(INC_ROOT . '/mode.php'), 'view' => new Twig(), 'templates.path' => INC_ROOT . '/app/views' ]); // Run some crap before the middleware //$app->add(new BeforeMiddleware); //$app->add(new CSRFMiddleware); $app->configureMode($app->config('mode'), function() use ($app) { $app->config = Config::load(INC_ROOT . "/app/config/{$app->mode}.php"); }); // Database configs require 'database.php'; // Filters require 'filters.php'; // Routes configs require 'routes.php'; //$app->auth = false; // Album singleton $app->container->set('album', function() { return new Album; }) // Song singleton $app->container->set('song', function() { return new Song; }); // Slappin' some hoes with our views $view = $app->view(); $view->parserOptions = [ 'debug' => $app->config->get('twig.debug') ]; $view->setTemplatesDirectory('../app/views'); $view->parserExtensions = [ new TwigExtension() ]; // Run Slim $app->run();