Permalink
Browse files

Remove dependency on KnpMenuBundle.

Removes sonata.block.service.menu when KnpMenuBundle isn't active.
  • Loading branch information...
kibao committed Jan 28, 2014
1 parent e69c9e3 commit 2b2f27f7f42e8a0b7da9792d02781ab06d9cdcd1
Showing with 6 additions and 0 deletions.
  1. +6 −0 DependencyInjection/SonataBlockExtension.php
@@ -73,6 +73,12 @@ public function load(array $configs, ContainerBuilder $container)
*/
public function configureMenus(ContainerBuilder $container, array $config)
{
+ $bundles = $container->getParameter('kernel.bundles');
+ if (!isset($bundles['KnpMenuBundle'])) {
+ $container->removeDefinition('sonata.block.service.menu');
+ return;
+ }
+
$container->getDefinition('sonata.block.service.menu')->replaceArgument(3, $config['menus']);
}

0 comments on commit 2b2f27f

Please sign in to comment.