• 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
src/Silex Loading commit data...
tests Loading commit data...
vendor Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
autoload.php Loading commit data...
compile.php Loading commit data...
example.htaccess Loading commit data...
phpunit.xml.dist Loading commit data...