0

我已经定义了一个带有注释的控制器

@Route("/add,{elId},{elType},{parentId}",name="MeaTask_Add", defaults={"elId"=null,"elType"=null, "parentId"=null})
public function addAction($elId=null, $elType=null, $parentId=null, Request $request){

我尝试像这里一样使用它

$this->generateUrl('MeaTask_Add',array(
                    'parentId'=>$parentId         
                ))

并得到

  An exception has been thrown during the rendering of a template ("Parameter "elType" for route "MeaTask_Add" must match "[^/,]++" ("" given) to generate a corresponding URL.") 
4

1 回答 1

0
@Route("/add/{elId}/{elType}/{parentId}",name="MeaTask_Add", defaults={"elId"=null,"elType"=null, "parentId"=null})

尝试使用斜杠我不注释路由 url 可以处理昏迷。

于 2015-04-08T11:52:50.110 回答