Переглянути джерело

remove the need of creating a custom controller for each entity

Thomas Rabaix 14 роки тому
батько
коміт
74086f3e85
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      DependencyInjection/AddDependencyCallsPass.php

+ 4 - 0
DependencyInjection/AddDependencyCallsPass.php

@@ -46,6 +46,10 @@ class AddDependencyCallsPass implements CompilerPassInterface
                 $definition->setArgument(0, $id);
                 $definition->setArgument(0, $id);
             }
             }
 
 
+            if (strlen($arguments[2]) == 0) {
+                $definition->setArgument(2, 'SonataAdminBundle:CRUD');
+            }
+
             $this->applyDefaults($definition, $attributes);
             $this->applyDefaults($definition, $attributes);
 
 
             $arguments = $definition->getArguments();
             $arguments = $definition->getArguments();