register(new TwigServiceProvider(), [ 'twig.path' => __DIR__.'/../views', ]); $app->register(new WhoopsServiceProvider()); $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) { $yaml = Yaml::parse(file_get_contents(APP_ROOT . 'yaml.yml')); dump($yaml); return $app['twig']->render('base.html.twig'); }); $app->run();