• Fabien Potencier's avatar
    changed Application to extend Pimple (this makes everything configurable) · 8a7b4321
    Fabien Potencier authored
    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(...);
    });
    8a7b4321
Name
Last commit
Last update
..
ApplicationTest.php Loading commit data...
BeforeAfterFilterTest.php Loading commit data...
ControllerCollectionTest.php Loading commit data...
ControllerTest.php Loading commit data...
ErrorHandlerTest.php Loading commit data...
FunctionalTest.php Loading commit data...
RouterTest.php Loading commit data...
WebTestCaseTest.php Loading commit data...