0

I have defined a controller with annotation

@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){

I try to use it like here

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

and get

  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.") 
Mohit Kanwar
  • 2,962
  • 7
  • 39
  • 59
Developer
  • 2,731
  • 2
  • 41
  • 71

1 Answers1

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

try with slashes i don't the annotation route url can handle coma.

Nawfal Serrar
  • 2,213
  • 1
  • 14
  • 22