我有一個錯誤,無法找到它從缺少的論點2:Symfony3爲CommonBundle 控制器 {}關閉()
->add('Webmaster', ChoiceType::class, array(
'required' => false,
'choices' => $listWebmasters,
'choice_label' => function($value, $key, $index)
{
return ($this->getDoctrine()->getManager()->getRepository('CommonBundle:Compte')->find($value)->getNom().' '.$this->getDoctrine()->getManager()->getRepository('CommonBundle:Compte')->find($value)->getPrenom());
},
'choice_value' => function($value, $key, $index)//Line of the error
{
return ($this->getDoctrine()->getManager()->getRepository('CommonBundle:Compte')->find($value)->getNom().' '.$this->getDoctrine()->getManager()->getRepository('CommonBundle:Compte')->find($value)->getPrenom());
}))
我想沒有「choice_value」選項,它的工作原理;我嘗試了一個'choice_label'的副本,但仍然無法正常工作。 'choice_value'被用作'choice_label'。 http://symfony.com/doc/current/reference/forms/types/choice.html#choice-value
編輯
確切的錯誤:
Warning: Missing argument 2 for CommonBundle\Controller\DefaultController::CommonBundle\Controller{closure}()
你可以編輯你的文章,並顯示確切的錯誤是什麼? –
完成。這與標題完全相同。 –
錯誤消息似乎指向您的控制器代碼。你能在其他地方發佈更多嗎? –