Browse Source

Merge pull request #735 from havvg/2.0

allow multiple filter type tags
Thomas 13 năm trước cách đây
mục cha
commit
869660f190

+ 4 - 4
DependencyInjection/Compiler/AddFilterTypeCompilerPass.php

@@ -32,13 +32,13 @@ class AddFilterTypeCompilerPass implements CompilerPassInterface
         $types      = array();
 
         foreach ($container->findTaggedServiceIds('sonata.admin.filter.type') as $id => $attributes) {
-            $name = $attributes[0]['alias'];
-
             $container->getDefinition($id)->setScope(ContainerInterface::SCOPE_PROTOTYPE);
 
-            $types[$name] = $id;
+            foreach ($attributes as $eachTag) {
+                $types[$eachTag['alias']] = $id;
+            }
         }
 
         $definition->replaceArgument(1, $types);
     }
-}
+}