Skip to content

Commit

Permalink
Fix twig extension loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Béhier-Dévigne committed Apr 5, 2020
1 parent 954f10a commit ae8f950
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/BoltOpenAgendaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Bolt\Extension\Leskis\BoltOpenAgenda\OAEventsProvider;
use Bolt\Extension\SimpleExtension;
use CalendR\Extension\Silex\Provider\CalendRServiceProvider;
use CalendR\Extension\Twig\CalendRExtension;
use Silex\Application;
use Symfony\Component\HttpFoundation\ParameterBag;

Expand Down Expand Up @@ -67,6 +68,14 @@ function ($app) {
'oaevents' => new OAEventsProvider($app['bolt-openagenda.config'])
)
));

$app['twig'] = $app->extend(
'twig',
function (\Twig_Environment $twig) use ($app) {
$twig->addExtension(new CalendRExtension($app['calendr']) );
return $twig;
}
);
}

/**
Expand Down

0 comments on commit ae8f950

Please sign in to comment.