Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
フォームが作成された後、Symfony2 を使用してプログラムでフォームに値を設定するには、次の方法が機能することがわかりました。
$form_data = $form->getData(); $form_data['name'] = 'new value'; $form->setData($form_data);
これは厄介です。次のような簡単な方法はありません$form->set('name', 'new value');か?
$form->set('name', 'new value');
$form->get('name')->setData('new value');