浏览代码

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);
             }
 
+            if (strlen($arguments[2]) == 0) {
+                $definition->setArgument(2, 'SonataAdminBundle:CRUD');
+            }
+
             $this->applyDefaults($definition, $attributes);
 
             $arguments = $definition->getArguments();