Skip to content

Commit

Permalink
Use "extend()" to configure Twig.
Browse files Browse the repository at this point in the history
This change is needed due to the removal of the "twig.configure" service.
  • Loading branch information
nrk committed Jul 8, 2012
1 parent fd7aa6a commit 7a3a9d1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@

$app->register(new TwigProvider(), array(
'twig.path' => __DIR__.'/../template',
'twig.configure' => $app->protect(function($twig) {
$twig->addExtension(new LamestTwigExtension());
}),
));

$app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
$twig->addExtension(new LamestTwigExtension());

return $twig;
}));

$app->register(new LamestServiceProvider(), array(
'lamest.options' => array(
'site_name' => 'Lamest News',
Expand Down

0 comments on commit 7a3a9d1

Please sign in to comment.