FormBuilder を使用してフォームを作成しています。それはうまくいきます。問題は、オプション付きの選択フィールドを作成する「ライセンス オブジェクト」です。これらのオプションは翻訳する必要があります。しかし、それを行う方法は?
$form = $this ->createFormBuilder($request)
->add('title', 'text',
array( 'label' => $this->get('translator')->trans('form.title', array(), 'client_request_a_photo'))
)
->add('description', 'textarea',
array( 'label' => $this->get('translator')->trans('form.description', array(), 'client_request_a_photo'))
)
->add('licence','document',
array('class'=>'WunschbildBundle\Document\Licence', 'property'=>'options',
'label' => $this->get('translator')->trans('form.licence', array(), 'client_request_a_photo'))
)
->getForm();