changed Application to extend Pimple (this makes everything configurable)
You can now use the app instance to store objects or parameters: $app = new Application(); $app['twig'] = new \Twig_Environment(...); $app['debug'] = true; $app->get('/', function() use ($app) { return $app['twig']->load('index.html')->render(array()); }); For sercices, you can even make them lazy loaded and/or shared: $app['twig'] = $app->asShared(function () { return \Twig_Environment(...); });
Showing
Please register or sign in to comment