register(new TwigServiceProvider(), [ 'twig.path' => __DIR__.'/../views', ]); $app['config'] = function($app) { $configFromFiles = \Noodlehaus\Config::load(APP_ROOT . 'config'); $defaultOptions = new \Sikofitt\Config($configFromFiles->all()); return $defaultOptions; }; $app->register(new WhoopsServiceProvider()); $app->register(new \Silex\Provider\AssetServiceProvider()); $app->register(new \Silex\Provider\MonologServiceProvider()); $app->register(new \Silex\Provider\VarDumperServiceProvider()); $app->register(new \Silex\Provider\HttpKernelServiceProvider()); $app['json.decoder'] = function($app) { return new Webmozart\Json\JsonDecoder(); }; $app['json.encoder'] = function($app) { return new Webmozart\Json\JsonEncoder(); }; $app['json.validator'] = function($app) { return new Webmozart\Json\JsonValidator(); }; $app->get('/', function() use($app) { $decoded = $app['json.decoder']->decodeFile(APP_ROOT . 'resume.json', APP_ROOT . 'resume.schema.json'); dump($app['config']->get('app.debug')); return $app['twig']->render('base.html.twig', ['resume' => $decoded]); }); $app->run();