Skip to content

Commit

Permalink
Fix silex2 compability
Browse files Browse the repository at this point in the history
  • Loading branch information
Zlatko Hristov committed Jul 16, 2016
1 parent 62f5737 commit 3f24b40
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/MediaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ public function register(Container $app)
{

if ($app->offsetExists('form.factory')) {
$app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) {
$app['form.types'] = $app->extend('form.types', function ($types) use ($app) {
$types[] = new Form\Type\MediaType($app);
return $types;
}));
});
}

if ($app->offsetExists('twig')) {
$app['twig'] = $app->share($app->extend('twig', function(\Twig_Environment $twig) use ($app) {
$app['twig'] = $app->extend('twig', function(\Twig_Environment $twig) use ($app) {
$twig->addExtension(new Twig\MediaExtension($app));
return $twig;
}));
});

$app['twig.path'] = array_merge($app['twig.path'], array(
__DIR__ . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'views'
Expand Down

0 comments on commit 3f24b40

Please sign in to comment.